You need to sign in to do that
Don't have an account?

PHP Relationship Query Results
I have a query that when I print with the following.....
<?php print_r($record); ?>
I get....
Array ( [rie__Session__r] => sObject Object ( [type] => rie__Session__c [id] => [values] => Array ( [Name] => Forum M-22: 3-D Flash [rie__Session_Abstract__c] => Test Description ) [fieldsToNull] => ) [Name] => Shawn Adams [rie__Session__c] => a0Ro0000006Q1uJEAS )
This works fine...
<?php echo $record['Name']?>
I get... Shawn Adams
Neither of these work...
<?php echo $record[rie__Session__c.Name] ?>
<?php echo $record[rie__Session__r.Name] ?>
<?php echo $record->sobjects[0]->values->rie__Session__c->Name; ?>
Any suggestions?
Thanks
<?php print_r($record); ?>
I get....
Array ( [rie__Session__r] => sObject Object ( [type] => rie__Session__c [id] => [values] => Array ( [Name] => Forum M-22: 3-D Flash [rie__Session_Abstract__c] => Test Description ) [fieldsToNull] => ) [Name] => Shawn Adams [rie__Session__c] => a0Ro0000006Q1uJEAS )
This works fine...
<?php echo $record['Name']?>
I get... Shawn Adams
Neither of these work...
<?php echo $record[rie__Session__c.Name] ?>
<?php echo $record[rie__Session__r.Name] ?>
<?php echo $record->sobjects[0]->values->rie__Session__c->Name; ?>
Any suggestions?
Thanks
It's been a long time since I've dabbled in PHP, but I believe you need something like the following:
Or
Basically speaking, record is an array of fields, containing a key "rie__Session__r". "rie__Session__r" is an object, and contains a key called "values" which contains all the fields to print off, inlcuding the name of the rie__Session__r record.
All Answers
It's been a long time since I've dabbled in PHP, but I believe you need something like the following:
Or
Basically speaking, record is an array of fields, containing a key "rie__Session__r". "rie__Session__r" is an object, and contains a key called "values" which contains all the fields to print off, inlcuding the name of the rie__Session__r record.
Thi one owrks...
echo $record['rie__Session__r']->values['Name'];
Thanks!!!
<?php echo $record['rie__Contact_Name__r']->values['Account']->values['Name']?>