I am trying to update a field in salesforce and for some reason it doesn't do anything. here is my code:
class Salesforce {
private static $mySforceConnection;
private static $instance;
private function __construct() {
self::$mySforceConnection = new \SforceEnterpriseClient();
self::$mySforceConnection->createConnection(storage_path("app/wsdl/wsdl.xml"));
self::$mySforceConnection->login();
}
static public function updateOppertunityStatus($status,$recordId){
$records = new \stdClass();
$records->ID = $recordId;
$records->Status__c = $status;
self::$mySforceConnection->update($records,'Opportunity');
}
}
I can connect to salesforce and retrieve data and for some reason, the update does not give me an error but not updating the field. also checked that the ID is correct.
Thanks
update
what does the response look like from the Salesforce server? Is it an HTTP 200?$records
passed toupdate
is missing anId
. I am not familiar with the PHP library you're using but I would double-check that$recordId
is notnull
inupdateOppertunityStatus
and that$records->ID
is valid syntax. Check thatID
isn't causing issues on the SOAP API side and that the API isn't expecting lowercaseid
orId
.