function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kallam salesforce1kallam salesforce1 

Suppose there are 10 duplicate records in an object and you want to delete 9 records and retain the latest record, how would you do it?

PriyaPriya (Salesforce Developers) 
Hey kallam,

For your requirement, you can refer this sample code and modify yours accordingly.