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
JonSimmonsJonSimmons 

Queryresults missing Id?

I'm just starting to work with the API in PHP and I have run into something odd.

Given this simple query, my results contain everything except the Id of the returned record.

Am I missing something, the Id field is there, but it contains a '0', not the Id of the returned record as expected.

 

 

 

    $query = 'Select UnitPrice, Quantity, PricebookEntryId, OpportunityId, Id From OpportunityLineItem WHERE OpportunityId = \'' . $opportunityId . '\' AND PricebookEntryId = \'' . $salesTaxPricebookEntryId .'\'';
     

      $response = $mySforceConnection->query($query);
      $queryResult = new QueryResult($response);

 

 

 

 

QueryResult Object
(
    [queryLocator] =>
    [done] => 1
    [records] => Array
        (
            [0] => SObject Object
                (
                    [type] =>
                    [fields] => stdClass Object
                        (
                            [OpportunityId] => 006S0000002pi1YIAQ
                            [PricebookEntryId] => 01uS0000000xeDiIAI
                            [Quantity] => 1.0
                            [UnitPrice] => 47.5
                        )

                    [Id] => 0
                )

        )

    [size] => 1
)

Best Answer chosen by Admin (Salesforce Developers) 
JonSimmonsJonSimmons

I figured it out.  It turns out that I was specifying the PartnerUrl for my endpoint but using the Enterprise Wsdl .