This is a discussion on Need help on delete() function within the Salesforce Coding Discussions forums, part of the Salesforce category; I am trying to delete, and can't grasp the idea of the
-
Need help on delete() function
I am trying to delete, and can't grasp the idea of the Id as Array.
I want to delete a bulk of Id's at once. I know I need to make an Array, but can't figure out what type of object they need to be in.
PHP Code:
$ids = array('a0A200000007v2D');
$deleteResult = $mySforceConnection->delete($ids);
Any advise please, thanks.
-
Code:
require_once ('soapclient/SforcePartnerClient.php');
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("soapclient/partner.wsdl.xml");
$mylogin = $mySforceConnection->login($user, $pass);
$array = array($id1, $id2);
$result = $mySforceConnection->delete($array);
print_r($result);
This code worked for me. Try putting the print_r statement afterwards and see what you get. Also, what kind of record are you trying to delete e.g. contact, account, lead, etc?
-
Hi Ncee,
The object I am trying to delete is a custom object, but I don't think it matters.
As for your example, I still don't understand, what type are the $id1 and $id2 are of? strings??
Where are they populated from?
-
I tested my delete out using contact ids. You can find these ids by using the force IDE or by selecting a record in salesforce and looking at the url.
Are you trying to delete the object or a record in the object?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Bookmarks