Undelete
Restores records previously deleted and stored in Salesforce's Recycle Bin.
Procedure-Specific Information
To restore an object from Salesforce's recycle bin you need to use one of the following examples:
1. By specifying the Id of the deleted record.
EXECUTE Undelete Id = '1'
2. By specifying a list of deleted record Ids.
INSERT INTO Account#TEMP (ID) VALUES (1) INSERT INTO Account#TEMP (ID) VALUES (2) INSERT INTO Account#TEMP (ID) VALUES (3) EXECUTE Undelete Id = 'Account#TEMP'
3. By specifying a list of Ids that are XML formatted.
EXECUTE Undelete XML = '<undelete xmlns="urn:enterprise.soap.sforce.com"> <ids>1</ids> <ids>2</ids> <ids>3</ids> </undelete>'
Input
| Name | Type | Description |
| ID | String | The unique identifier of the deleted object to restore. Required if XML is not provided. |
| XML | String | An XML-formatted list of object IDs to restore. Use this to undelete multiple records in a single request. Required if ID is not specified. |
Result Set Columns
| Name | Type | Description |
| Success | String | Indicates whether the undelete operation was successful (true) or not (false). |
| ID | String | The ID or IDs of the objects that were successfully restored. |