Get Salesforce value for custom field

I am trying to get the value of a custom field in salesforce. I am trying to use this sample code:

http://wiki.developerforce.com/index.php/PHP_Toolkit_20.0_Query_Sample_(Enterprise )

And add the name of the custom field to select. However, the selection works, but my output does not contain a custom field (only the other fields in my selection).

$response = $client->query(SELECT Id,Name, Custom_field__c from Account limit 5); 

I also tried using the retrieve () method instead of query (), but this gives me the same problem.

Any ideas?

Thanks!

+4
source share
3 answers

I realized that it was rather 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 from my account. If wsdl has no fields that you do not see in the answer.

+4
source

Are you using the user you are connecting with and have permission to view this field? Depending on your version of Salesforce, you will have to either add it to the page layout (Professional Edition) or add it to your profile.

I would use ForceExplorer to issue a SOQL statement and make sure all permissions, etc. work first.

+2
source

You also need to disable the WSDL cache

 ini_set('soap.wsdl_cache_enabled', '0'); 
+1
source

Source: https://habr.com/ru/post/1342735/


All Articles