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

Missing certain fields in query results - using PHP Toolkit 11 with Enterprise wsdl

Hi again,

I am sure the answer to this is simple - I just can't see it.

I am using PHP Toolkit 11.0 with Enterprise wsdl. When I run a query (on a custom object), PHP does not get all of the result fields, even though all requested fields are being returned in the SOAP response. I cleared the wsdl cache before running this.

Here is a code snippet, a PHP dump of the result, and the SOAP parts. The missing field is Client_Timezone__c.

Code snippet re query:

function getMCMClientProfile($wc='') {
    global $sf_connection;
    $query = "Select Id, Name, Client_Phone_Number__c, Reject_Calls_From__c, Client_Timezone__c, ...(other fields)
            from MCM_Client__c  " . $wc;
    try {
        $queryOptions = new QueryOptions(50);
        $response = $sf_connection->query(($query), $queryOptions);
        $p_response = print_r($response, true);
        echo "getMCMClientProfile: response=$p_response\n"; // A
        $last_request = $sf_connection->getLastRequest();
        echo "getMCMClientProfile: last_request=$last_request\n"; // B
        $last_request_hdrs = $sf_connection->getLastRequestHeaders();
        echo "getMCMClientProfile: last_request_hdrs=$last_request_hdrs\n"; // C
        $last_response = $sf_connection->getLastResponse();
        echo "getMCMClientProfile: last_response=$last_response\n"; // D
A: --- PHP Dump: Client_Timezone__c is missing
getMCMClientProfile: response=stdClass Object
    [done] => 1
    [queryLocator] =>
    [records] => Array
            [0] => stdClass Object
                    [Id] => a0670000002FZVdAAO
                    [Client_Phone_Number__c] => 914 555-1212
                    [Name] => Market Arch
                    [Reject_Calls_From__c] => Alabama;Hawaii
                    ...(other fields) <----------- Client_Timezone__c is missing


    [size] => 1

B: last_request
getMCMClientProfile: last_request=<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1=""><SOAP-ENV:Header><ns1:SessionHeader><ns1:sessionId>461700D70000000K7PB!ARMAQEciKYNI24gPu2kL09V3cgtt8s7w3GDUKftmZN6f4CjNMsf5IlFHzoGQhULQbgrwijdzDnmwgwpBghWktndP9cgXmW2q</ns1:sessionId></ns1:SessionHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:query><ns1:queryString>Select Id, Name, Client_Phone_Number__c, Reject_Calls_From__c, Client_Timezone__c, &#13;
...(other fields)
            from MCM_Client__c  where Id = 'a0670000002FZVdAAO'</ns1:queryString></ns1:query></SOAP-ENV:Body></SOAP-ENV:Envelope>

C: last_request_hdrs
getMCMClientProfile: last_request_hdrs=POST /services/Soap/c/12.0/461700D70000000K7PB HTTP/1.1
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.0
Accept-Encoding: gzip, deflate
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 1083

D: -- last_response: Note that Client_Timezone__c is present
getMCMClientProfile: last_response=<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="" xmlns="" xmlns:xsi="" xmlns:sf="">
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:MCM_Client__c">
<sf:Client_Phone_Number__c>914 555-1212</sf:Client_Phone_Number__c>
<sf:Client_Timezone__c>(GMT-05:00) Eastern Standard Time (America/New_York)</sf:Client_Timezone__c>
<sf:Name>Sample Name</sf:Name>

Why does Client_Timezone__c get lost on the way to PHP??? Can anyone help?

Any comments or pointers are very much appreciated.

Colin Goldberg

Tran ManTran Man
Check to make sure that your enterprise wsdl has that particular field.  Did you redownload the Enterprise WSDL after you made changes to your schema?

On a different topic, the usage of QueryOption is different now in the v11 of the toolkit.  Please see the QueryOptions sample on this wiki page: