Knowledge Center

Knowledge Center > API > SOAP API > SOAP API Calls > delete()

delete()

 

Deletes one or more objects of the same type. You can specify different types in different delete calls, but each delete call must only apply to one type of object.

Usage

You can call delete() with a string type of zObject and a list of IDs of that type. It returns an array of DeleteResult, indicating the success or failure of deleting each object.

The following information applies to this call:

  • You will need to first determine the IDs for the objects you wish to delete.
  • You cannot pass in any null IDs.
  • All objects in a specific delete() call must be of the same type.

Objects per Call Limits

50 objects are supported in a single call.

Syntax and Arguments

DeleteResult[] = delete(type, ID[]);

Argument Description
type The type of object that you are deleting.
ids[] A list of one or more IDs for the objects you want to delete.

Response

DeleteResult

Faults

Possible faults are listed on the separate Faults page.

Sample Code

The following sections provide examples of using the delete() call.

Sample Code for Java

Delete delete = new Delete();delete.setType("Account");ID id = new ID();id.setID("402881491bd3cc34011bd3eb0c300092");delete.setIds(id);ServiceStub.DeleteResponse res = stub.delete(delete, header);ServiceStub.DeleteResult[] sr = res.getResult();

Sample SOAP Request to Delete a Single Object

<ns1:delete>  <ns1:type>Usage</ns1:type>  <ns1:ids>4028e699235ea4de0123777131fd5d68</ns1:ids></ns1:delete>

Sample SOAP Request to Delete Multiple Objects

<ns1:delete>  <ns1:type>Usage</ns1:type>  <ns1:ids>4028e699235ea4de0123777131fd5d68</ns1:ids>  <ns1:ids>4028e699235ea4de0123777132125d6b</ns1:ids></ns1:delete>
Last modified

Tags

Classifications

(not set)