Force.com-Toolkit-for-PHP icon indicating copy to clipboard operation
Force.com-Toolkit-for-PHP copied to clipboard

(upd: solved) Old Bug: API Query "Only Returns Id" Not The Requested Fields (php)

Open lordspace opened this issue 9 years ago • 0 comments

Hi, I am getting the same error that this guy had 10 years ago by querying to a custom object. ref: https://developer.salesforce.com/forums/?id=906F00000008tQnIAI Querying contacts works just fine.

I've also set this: ini_set('soap.wsdl_cache_enabled', '0');

Update: Solved it by regenerating a new enterprise.wsdl by following these steps. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_steps_generate_wsdl.htm

QueryResult Object
(
    [queryLocator] => 
    [done] => 1
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [Id] => a0037000003WH16AAG
                )

            [1] => stdClass Object
                (
                    [Id] => a0037000003WH17AAG
                )

            [2] => stdClass Object
                (
                    [Id] => a0037000003WH18AAG
                )

            [3] => stdClass Object
                (
                    [Id] => a0037000003WHXaAAO
                )

            [4] => stdClass Object
                (
                    [Id] => a0037000002iG3tAAE
                )

        )

    [size] => 5
    [pointer] => 0
    [sf:QueryResult:private] => SforceEnterpriseClient Object
        (
            [sforce:protected] => SoapClient Object
                (
                    [trace] => 1
                    [compression] => 32
                    [_encoding] => utf-8
                    [_features] => 1
                    [_user_agent] => salesforce-toolkit-php/27.0
                    [_soap_version] => 1
                    [sdl] => Resource id #154
                    [__last_request_headers] => POST /services/Soap/c/27.0/00D37000000KONo HTTP/1.1
Host: na31.salesforce.com
Connection: Keep-Alive
User-Agent: salesforce-toolkit-php/27.0
Accept-Encoding: gzip, deflate
Content-Type: text/xml; charset=utf-8

lordspace avatar Apr 27 '16 21:04 lordspace