I am trying using SOAP API with phptoolkit. while trying to query all the order fields I only get standard fields, my order object contains some other fields create due installation of managed package.these fields are not returned and a error is thrown?

How to fix this?

For code sinppet: here it is:

            define("USERNAME", "abhilash@dev.org");
            define("PASSWORD", "dCEm96uPgRHJ");
            define("SECURITY_TOKEN", "AdTdD3hPtVYr1RNbt6re4OnqO");
            require_once ("Force.com-Toolkit-for-PHP-master/soapclient/SforceEnterpriseClient.php");
            $mySforceConnection = new SforceEnterpriseClient();

            $response=$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
            echo "<pre>";
            print_r($mySforceConnection->query("select id,ordernumber from order"));
            echo "</pre>";


I tried it using WSDL 27.0 available with php toolkit. I returned only ID But gives no error for managed fields.

using latest wsdl of my org. 36.0 it gives error

Here is the snapshot of output https://qas-shared-assets.s3.amazonaws.com/snaps/4uz5infz2gldi

  • Please append namespace in your field name.. – Amit Chaudhary Jun 2 '16 at 7:53
  • Can you share your code snippet? – Gaurav Kheterpal Jun 2 '16 at 7:54
  • Could you please provide screenshot depicting the error you receive or can you copy the error message in your question? Did you prepend the requested field names with managed package prefix? – Patlatus Jun 2 '16 at 9:42
  • @GauravKheterpal updated the code snippet – Abhilash Mishra Jun 3 '16 at 12:35

In your salesforce org go to Setup->Create->Objects. Find the object which you want to access. Look for its API Name. The API name will have an namespace prefix attached.

Every managed package has a namespace prefix attached with it. In your Salesforce org if you go to Setup-> Installed Packages. You will find packages with its own namesapce. See the namespace prefix of the managed package you want to access.In order to access any metadata of that package you will have to append namespace prefix.

| improve this answer | |
  • object is already enabled for API access, and I have given all the access. – Abhilash Mishra Jun 3 '16 at 12:28
  • how to fix this issue, – Abhilash Mishra Jun 8 '16 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.