$records[0]->fieldsToNull = 'Phone'; $records[1] = new stdclass(); $records[1]->Id = $ids[1]; $records[1]->fieldsToNull = 'Phone'; $response = $mySforceConnection->update($records, 'Contact'); foreach ($response as $result) { echo $result->success == 1 ? $result->id . " updated<br/>\n" : "Error: " . $result->errors->message . "<br/>\n"; } echo "<br/>Retrieve the updated records again to check the update:"; echo "<br/><br/>\n"; $response = $mySforceConnection->retrieve('Id, FirstName, LastName, Phone', 'Contact', $ids); foreach ($response as $record) { echo $record->Id . ": " . $record->FirstName . " " . $record->LastName . " " . $record->Phone . "<br/>\n"; } echo "<br/>Finally, delete the records:<br/><br/>\n"; $response = $mySforceConnection->delete($ids); foreach ($response as $result) { echo $result->success == 1 ? $result->id . " deleted<br/>\n" : "Error: " . $result->errors->message . "<br/>\n"; } echo "</td><td>"; echo "Now let's use the partner client<br/><br/>\n"; $mySforceConnection = new SforcePartnerClient(); $mySforceConnection->createConnection("soapclient/partner.wsdl.xml"); if (isset($_SESSION['partnerSessionId'])) { $location = $_SESSION['partnerLocation']; $sessionId = $_SESSION['partnerSessionId']; $mySforceConnection->setEndpoint($location); $mySforceConnection->setSessionHeader($sessionId); echo "Used session ID for partner<br/><br/>\n"; } else { $mySforceConnection->login(USERNAME, PASSWORD . SECURITY_TOKEN);