Skip Ribbon Commands
Skip to main content
Navigate Up
Sign In

Quick Launch

Average Rating:

facebook Twitter
Email
Print Bookmark Alert me when this article is updated

Feedback

Delete data from Target which are not in Source (Salesforce or any DB) | Template to delete data from target
Content

DRS task (Data Replication task)


Only for Salesforce source type.
  • In the Source tab, select "Include archived and deleted rows in the source".
  drs_src.JPG
  • In the Target tab, select "Remove deleted columns and rows" under Delete Options. Target should be databases.

 drs_tgt.JPG
This will set the SOQL query to include all the deleted records from recycle bin and as in the target, delete option is selected, those deleted records will be removed from the target as well.

This task is the best to delete records from the target which are not in the source but will not work for the following two cases:

1. If data has been deleted from Salesforce recycle bin (please check More Information section), this option will not work.
2. Deleted records are not pulled in DRS when the records are created and deleted between two incremental runs.

-----------------------------------------------------------------------------------------------------------------------------------------

DSS task (Data Synchronization task)

Only for Salesforce source type.
  • In the Definition tab, select "Delete" from Task Operation dropdown.
  dss_def.JPG
  • In the Source tab, Select "Include archived and deleted rows in the source"
 dss_src.JPG
  • In the Data Filters tab, select IsDeleted column (Boolean field) for the source Object and set the value as True.
     dss_fltr.JPG
  • Select Target from where the data should be deleted.

This will set the SOQL query only to fetch those records which are in the deleted status (in Salesforce recycle bin) and will delete those records from the target as the operation has been selected as Delete.

This task will delete only those records which are the result of the filter, here deleted data from Salesforce recycle bin. This task can be used if there are some records which have been created and deleted between two incremental runs.

-----------------------------------------------------------------------------------------------------------------------------------------

Above two tasks will work if the data is deleted and is in recycle bin (which will be marked in the IsDeleted column as True). If the data deletion time has crossed the retention period and is deleted from the recycle bin, those records can not be retrieved at the source level or using a filter, hence can not be deleted from the target.

To remove such records, follow the below-mentioned method to create a mapping which will compare source data with target and remove those from the target.

-----------------------------------------------------------------------------------------------------------------------------------------

Mapping

1. Create a mapping to join Source and Target (salesforce or any DB will work in this method) and create the output as unmatched from Target (Let's assume output name is DltTgt)
2. Create a MappingTask for this mapping.
3. a) Create a DSS task and In Definition tab, select "Delete" from Task Operation dropdown
    b) Select DltTgt as source
    c) Select Target from where the data should be deleted.
4. In a Linear Taskflow, add the mapping and the DSS to run in sequence.

This task will compare and create a list of data which are only in target, not in source. In the next DSS task, that list will be used as the source and to delete from the same target.
In this manner, no matter when the data was deleted, if some data is not there in Source but is in Target, that will be captured in this list and eventually will be deleted from the Target.


More Information
​Salesforce retention period for deleted records is of 15 days as of Sep, '19.



Reference


Attachments


Applies To
Product: Cloud Data Integration
Problem Type: Configuration; Product Feature; Performance
User Type: Developer; Architect
Project Phase: Configure; Implement; Optimize
Product Version:
Database:
Operating System:
Other Software:

Last Modified Date: 9/18/2019 10:38 PM ID: 594228
People who viewed this also viewed

Feedback

Did this KB document help you?



What can we do to improve this information (2000 or fewer characters)