You need to sign in to do that
Don't have an account?
JimA
Access field Contact.FirstName from Case query
Hi All,
If I'm running the following query:
SELECT Id, AccountId, Contact.FirstName FROM Case
How do I access the Contact.FirstName value with the PHP toolkit? I tried $sObject->fields->FirstName but it doesnt work.
Thanks for the help!
can't remember at the moment, but var_dump is your friend ;)
try
var_dump($sObject);
--Alex
SELECT Case.ID, Case.AccountId, Case.ContactId, Contact.FirstName
FROM Case, Contact
WHERE Case.ContactId = Contact.Id
The WHERE clause would be required here, because you're requesting information that's stored in multiple objects, and the server needs to know how to join them.
Again, that's paraphrased, but hopefully it'll get you going in the right direction.
-R
-R
I was able to access the FirstName information by:
$sObject->sobjects[0]->fields->FirstName
but the fact that sobjects is an array worries me. Im getting NULL answers for some Cases and have not yet checked to see if the array ever has more than one item. It appears as though Case/Contact ratio is not always 1:1, so you may want to run a foreach loop on $sObject->sobjects.