Delete job example

  • 24Views
  • Last Post 09 October 2018
0
votes
Marina Seredova posted this 08 October 2018

 Can you share an example of a Salesforce delete job . MY requirement is that the job should be able to delete the records in Salesforce if those have been deleted in SQL server.

How can I map deleted record ids in the job ? I dont have a reference to the record ids in source table after deletion

Order By: Standard | Newest | Votes
0
votes
Marina Seredova posted this 09 October 2018

No updates on this?

0
votes
Marina Seredova posted this 09 October 2018

The documentation gives an example of UPDATE but not of DELETE. So please share a scenario where we can delete records using jobs

0
votes
Simon Bubnov posted this 09 October 2018

Skyvia import package with the delete operation uses mapping to identify records that should be deleted. For the delete operation you map only Id field. If a record with such Id is found, the found record is deleted.

 

Thus, you need to have records, that should be deleted in Salesforce, in your source SQL Server. In your case, the records are already deleted in SQL Server, and thus, Skyvia package can't perform delete operation for records that are already deleted in source.

 

As a workaround, you can create a trigger, which will copy rows that you delete to another table. The following link can be helpful for you: https://stackoverflow.com/questions/14018982/insert-deleted-values-into-a-table-before-delete-with-a-delete-trigger

 

Suppose, your source table is named table1, and you copy the deleted records to table2. In this case, you can create an import package with the delete operation from table2, containing the deleted records from table1. As the result, the records, deleted from table1, will be deleted from Salesforce.

 

Mapping for the Id field should be configured for the delete operation in the same way as for the update operation. For more information, please refer to https://skyvia.com/resources/docs/index.html?performing_update_and_delete.htm

 

Feel free to contact us if you have any further questions.

Close