Delete via WSProxy

To delete a single item or several items of the same type in a single call, use the deleteItem() and deleteBatch() functions.

  • Specify the first two parameters of the delete functions like you do for the create functions.
  • The optional third parameter includes any properties to be set using the SOAP DeleteOptions object.

Example: Delete a Data Extension 

This example deletes a data extension using its object ID.

1var prox = new Script.Util.WSProxy();
2var objectID = "c9875a80-4dad-e411-b071-ac7ba13db5bc";
3
4var res = prox.deleteItem("DataExtension", { ObjectID: objectID });

You can’t delete a data extension if it has a data relationship to contact records or to another data extension. To delete a data extension that has a data relationship, first use Data Designer to remove the relationship, and then delete the data extension. See Data Designer in Salesforce Help.

Important

The returned object has the same properties as the Create functions, except the results contain properties from the SOAP DeleteResult items.

See Also