Hi, Data cleansing allows you to compare, include and merge redundant business partner master records (potential duplicates) in data cleansing cases. When the data cleansing process has been completed, you can remove data records from the system using archiving. Batch Apex is used to run large jobs (think thousands or millions of records!) that would exceed normal processing limits. Using Batch Apex, you can process records asynchronously in batches (hence the name, “Batch Apex”) to stay within platform limits. If you have a lot of records to process, for example, data cleansing or archiving, Batch Apex is probably your best solution. if you want more explanation then refer to these links: https://subscription.packtpub.com/book/application_development/9781782171164/4/ch04lvl1sec55/using-a-scheduled-batch-apex-to-clean-the-chatter-data
May I suggest you please refer to below links which has a good example with some pseudo code in it.
- http://www.sandeeparora.org/2014/10/batch-apex-data-cleansing-example-in-salesforce/
- https://developer.salesforce.com/forums/?id=906F0000000B3fYIAS
Hope this helps.Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
Data cleansing allows you to compare, include and merge redundant business partner master records (potential duplicates) in data cleansing cases. When the data cleansing process has been completed, you can remove data records from the system using archiving.
Batch Apex is used to run large jobs (think thousands or millions of records!) that would exceed normal processing limits. Using Batch Apex, you can process records asynchronously in batches (hence the name, “Batch Apex”) to stay within platform limits. If you have a lot of records to process, for example, data cleansing or archiving, Batch Apex is probably your best solution.
if you want more explanation then refer to these links:
https://subscription.packtpub.com/book/application_development/9781782171164/4/ch04lvl1sec55/using-a-scheduled-batch-apex-to-clean-the-chatter-data
http://www.sandeeparora.org/2014/10/batch-apex-data-cleansing-example-in-salesforce/
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha