• Web Department
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm following this (https://developer.salesforce.com/page/Tksample.php) tutorial and trying to performing a simple query with my SforcePartnerClient object...
$query = "SELECT Id, FirstName FROM Contact"
$response = $mySforceConnection->query($query);
foreach ($response->records as $record)
{
	echo $record->fields->FirstName;
}
...but the above code doesn't output anything. Looking at it in the debugger shows that "fields" is null. It DOES, however, seem to have the proper SOAP results inside "$record->any".

Any idea what might be wrong?

I have a custom object in our Salesforce setup called AgentProducts, when I do a query (code running in php) via the API the only field I can get back is Id;

 

select Id, User_Id__c from AgentProducts__c

 

returns a record for every one of the entries in AgentProducts, but only with the Id field;

Array
(
    [0] => stdClass Object
        (
            [Id] => a0350000008xWWKAA2
        )

    [1] => stdClass Object
        (
            [Id] => a0350000008xWWLAA2
        )
etc. 

 

Even worse, if I filter the query by something like my custom email field, I get back the correct Id for the correct account, but still, no further data;

select Id, User_Id__c from AgentProducts__c where Email__c='xxx@xxxxx.xxx'

 

returns:

stdClass Object
(
    [Id] => a0350000008xWWMAA2
)

 

Any ideas?  I've been looking through the online documentation but I can't find anything on custom objects needing special treatment.