• Jordan Lev
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Does anyone know how to call update() for more than one object at a time (using WebService_sforceService_Soal.php)? Here is the code I have for updating one record:
     $client = new SalesforceClient($SESSION);
     $client->_endpoint = $_COOKIE['sf_endpoint'];
    
     $myFields = array('type'=>'lead', 'Id'=>'00S20000007k888AAA', 'Company'=>'testCo');
     $result = $client->update($myFields);

This code works perfectly, but I cannot figure out how to pass more than one "sObject" (php array) to it. My first guess was to make $myFields an array of arrays, but that didn't work. Then I tried just adding more and more key/value pairs to the $myFields array ('type'=>'lead', 'Id'=>'00S20000007k888AAA', 'Company'=>'testCo1', 'type'=>'lead', 'Id'=>'00S20000007k9999BB', 'Company'=>'testCo2', etc. etc.) but that didn't work either.

Thanks for any help you can provide (I really don't want to make multiple calls to the update function).

-Jordan Lev
Does anyone know how to call update() for more than one object at a time (using WebService_sforceService_Soal.php)? Here is the code I have for updating one record:
     $client = new SalesforceClient($SESSION);
     $client->_endpoint = $_COOKIE['sf_endpoint'];
    
     $myFields = array('type'=>'lead', 'Id'=>'00S20000007k888AAA', 'Company'=>'testCo');
     $result = $client->update($myFields);

This code works perfectly, but I cannot figure out how to pass more than one "sObject" (php array) to it. My first guess was to make $myFields an array of arrays, but that didn't work. Then I tried just adding more and more key/value pairs to the $myFields array ('type'=>'lead', 'Id'=>'00S20000007k888AAA', 'Company'=>'testCo1', 'type'=>'lead', 'Id'=>'00S20000007k9999BB', 'Company'=>'testCo2', etc. etc.) but that didn't work either.

Thanks for any help you can provide (I really don't want to make multiple calls to the update function).

-Jordan Lev