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
ThenmozhiThenmozhi 

how to get contact field in php to salesforce integration

i am trying to get records from contact table here, i got id vales ,but i didn't get Name,Firstname values got some error like

Notice: Undefined property: stdClass::$Contact in E:\xampp\htdocs\php-toolkit\user_login_session\getRecors.php on line 54
Notice: Trying to get property of non-object in E:\xampp\htdocs\php-toolkit\user_login_session\getRecors.php on line 54


$query = "SELECT Id,Name,FirstName from Contact ";
$response = $mySforceConnection->query($query);

foreach ($response->records as $record)
{

echo '<tr><td>'.$record->Id[0].'</td> (its working)

<td>'.$record->fields->Name.'</td></tr>'; (here my error)
    
 }

 
ShashankShashank (Salesforce Developers) 
Try instead <td>.$record->Name.'</td></tr>';
ThenmozhiThenmozhi
Ya, Thank For your reply i already did this.anyway thank you Shashank  

     Eg:     
           $records[0] = new SObject();
           $records[0]->Id = $ids;
           $records[0]->fields = array(
            'Name' =>$lastname,
            'Title__c'=>$title,
            'First_name__c' =>$firstname,
            'Php_order_id__c'=>$id
        );