I am trying to delete a single Opportunity within Salesforce using the PHP toolkit. Please can someone tell me if I heading the right direction? I using the ID from the Opportunity to identify the correct record, Is there anything else I need?
include "includes/creds.php"; require_once ('soapclient/SforcePartnerClient.php'); require_once ('soapclient/SforceEnterpriseClient.php'); $mySforceConnection = new SforcePartnerClient(); $mySforceConnection->createConnection("PartnerWSDL.xml"); $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN); $records = array(); $records = new SObject(); $records->fields = array( 'Id' => '0064J00000Cxpeh' ); $records->type = 'Opportunity'; $response = $mySforceConnection->delete($records);
I get the error
Recoverable fatal error: Object of class SObject could not be converted to string in /var/www/thechapar/soapclient/SforceBaseClient.php on line 578
I'm not a salesforce expert, and the code is going to wrong but any help would be great. Thanks again