0

I am needing to echo 'Parent ID' (under CaseComments) for the array using PHP in Salesforce. Any suggestions on how to accomplish this, I have tried may different combinations with no success?

I have tried to: echo $record->CaseComments->records->{0}->ParentId

foreach ($response->records as $record) {
$sObject = new SObject($record);
echo "<pre>";
print_r($sObject);
echo "</pre>";`

Output:

SObject Object
(
[type] => 
[fields] => 
[Account] => stdClass Object
    (
        [Id] => 
        [Name] => Test Company
    )

[CaseComments] => stdClass Object
    (
        [done] => 1
        [queryLocator] => 
        [records] => Array
            (
                [0] => stdClass Object
                    (
                        [Id] => 00a0c00001ALfC5AAL
                        [CreatedDate] => 2018-05-03T17:10:00.000Z
                        [IsDeleted] => 
                        [IsPublished] => 
                        [LastModifiedById] => 0050c00000CmnRKAAZ
                        [LastModifiedDate] => 2018-05-03T17:10:00.000Z
                        [ParentId] => 5000c00001Z6KYoAAN
                        [SystemModstamp] => 2018-05-03T17:10:00.000Z
                    )

            )

        [size] => 1
    )

[CaseNumber] => TT-000xxxxx
[CreatedDate] => 2018-05-03T14:34:29.000Z
[Status] => Escalated To Vendor
[Subject] => Test Ticket
[Type] => Broken REP/RAPS Ring
)
Karlo Kokkak
  • 3,674
  • 4
  • 18
  • 33
user2680315
  • 113
  • 8

0 Answers0