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
chuckdubdubchuckdubdub 

AccountID in Contact table is blank via API

If I run this query via sforce Explorer:
 
Select Id, AccountID, LastName from Contact where email = 'username@domain.com'
 
I get data output for all fields, as expected.
 
However, if I run the same query via the API (see below), I get output for all fields except for the AccountID.  The value for this field is blank.

 
   $queryResult = $sfdc->query("select AccountID, id, FirstName, LastName from Contact where email = '$emaillogin'");
$record = $queryResult['records'];
 // getting the record pointer 
 $sfrecordid = $record->id;
// all of these will output except for accountid
$values = $record->values;
$firstname = $values['FirstName'];
$lastname = $values['LastName'];
 $accountid = $values['AccountID'];

  
Thanks for any suggestions!
 
Chuck
smozgursmozgur
Try;
 
$accountid = $values['AccountId'];
 
It should be case sensitive.
 
Suat
Amq WebAmq Web
Cool! Salesforce should raise an error "Field not found" if casing is not right as it does for unknow field. Silently returnng a blank value is just wrong.