• CaseyA3
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi,

 

I'm trying to pull out the values from a query (just pulling 1 id,name in this case); it works fine when I print the full result, but when I try to get each one it doesnt work.

 

 

 

$queryResult = $mySforceConnection->query($query); $records = $queryResult->records; foreach ($records as $record) { $record = new SObject($record); $_id = $record->Id; $_name = $record->fields->Name; echo $_id; echo $_name; } foreach ($records as $record) { print_r($record); }

 

 it outputs:

 


Notice: Trying to get property of non-object in /srv/home-www/salesforce/test.php on line 50


0

 

SObject Object ( [type] => Account [fields] => stdClass Object ( [Name] => TheStreet.com Inc ) [Id] => 0018000000ZIXKWAA5 ) 

 

 

Any ideas?  Looked around and saw about 10 different ways to grab the info but none of them worked.  Thanks!

 

Casey