Get Salesforce Custom Field Value
I'm trying to get the value of a custom field in salesforce. I'm trying to use this sample code:
http://wiki.develope开发者_开发问答rforce.com/index.php/PHP_Toolkit_20.0_Query_Sample_(Enterprise)
And add the custom field name to the select. The select works, however, my output does not contain the custom field (only the other fields in my select).
$response = $client->query(SELECT Id,Name, Custom_field__c from Account limit 5);
I've also tried using the retrieve() method instead of query() but that is giving me the same problem.
Any ideas?
Thanks!
I figured it out.. it was sort of embarrassingly simple but here it is (maybe it will save someone else a couple of hours one day):
I needed to get a new wsdl out of the account.. if the wsdl doesn't have the fields you don't see them in your response.
Does the user you're connecting as have permission to see that field? Depending on your edition of Salesforce you will either have to add it to the page layout (Professional Edition) or add it to their profile.
I would use ForceExplorer to issue the SOQL statement and verify all permissions etc are working first.
Also you need to disable WSDL cache by
ini_set('soap.wsdl_cache_enabled', '0');
精彩评论