function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Not getting all query fields from custom object - Enterprise wsdl v12.0 - PHP Toolkit 11.0

Hi There,

I must be tired.

Using the new PHP Toolkit (11.0) and Enterprise wsdl API v 12.0, I am only getting the Id field in the result.

Code snippet:
$get_query_fields = getSFQueryFields('Toll_Free_Number__c');
echo "query_fields=$get_query_fields\n";
$query = "SELECT $get_query_fields from Toll_Free_Number__c where Name='$phone_number'";
try {
  $queryOptions = new QueryOptions(50);
  $response = $sf_connection->query(($query), $queryOptions);
  $p_response = print_r($response, true);
  echo "response=$p_response\n";

query_fields=Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastActivityDate, Campaign__c
response=stdClass Object
    [done] => 1
    [queryLocator] =>
    [records] => Array
            [0] => stdClass Object
                    [Id] => a0870000001NxOZAA0


    [size] => 1

It should be obvious to me but it isn't. What am I doing wrong?

Colin G

After a good night's sleep, I have discovered the frustrations of the wsdl cache - a previous version of enterprise.wsdl.xml contained a binding to version 10.0 instead of version 12.0
ie. as in:
<!-- Soap Service Endpoint -->
    <service name="SforceService">
        <documentation>Sforce SOAP API</documentation>
        <port binding="tns:SoapBinding" name="Soap">
            <soap:address location=""/>

As soon as I removed the wsdl cache file (/tmp/wsdl-*), I was able to retrieve all the query fields.

As an aside: Even though I received no responses from my initial post, I do seriously value this forum. It enabled me to write down my thoughts, and in doing so I was (luckily this time) able to methodically solve my problem.

Colin Goldberg

Tran ManTran Man
Glad you figured it out.  The actual problem is that PHP caches the WSDL.  You can get around it by turning it off: 

See this wiki page:
Hi again,

Perhaps this should be a different thread, but it is related, so here it is:

I have a query requesting a rollup summary field from a custom object - which is not being returned in the response, even though the field is being sent in the response xml.

Here are the lastRequest and lastResponse strings. The field in question is Call_Log_Count__c.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="">
<ns1:query><ns1:queryString>Select Id, Default_Client__c, Name, Start_Date__c, End_Date__c, Last_Client_Used__c, Call_Log_Count__c from Campaign__c  where Id = 'a0770000002S0jTAAS'</ns1:queryString></ns1:query>

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="" xmlns="" xmlns:xsi="" xmlns:sf="">
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:Campaign__c"><sf:Id>a0770000002S0jTAAS</sf:Id><sf:Call_Log_Count__c>0.0</sf:Call_Log_Count__c><sf:Default_Client__c>a0670000002FZVdAAO</sf:Default_Client__c><sf:End_Date__c>2008-03-21</sf:End_Date__c><sf:Name>test data</sf:Name><sf:Start_Date__c>2008-02-27</sf:Start_Date__c></records>

As you can see, Call_Log_Count__c is included.

And the returned response:
stdClass Object
    [Id] => a0770000002S0jTAAS
    [Default_Client__c] => a0670000002FZVdAAO
    [End_Date__c] => 2008-03-21
    [Name] => test data
    [Start_Date__c] => 2008-02-27

Where did Call_Log_Count__c go?

Can anyone help?

Colin Goldberg