Achieve your business goals faster by unlocking our Salesforce Cloud Services.
List<Contact> conList = [select firstname, lastname from contact];
Map<String, ID> mMap = new Map<String, ID>();
for(Contact c: conList)
{
mMap.put(c.name, c.id);
}
List<Contact> uniqList = new List<Contact>();
List<Contact> delList = new List<Contact>();
Set<String> sSet = mMap.keySet();
Set<ID> uniqSet = new Set<ID>;
for(String s: sSet)
uniqSet.add(mMap.get(s));
for(Contact c1: conList)
if((uniqSet.contains(c1.id)))
uniqList.add(c1);
else
delList.add(c1);
delete delList;
Note: Use isDeleted=true & ALL ROWS keyword to get the deleted records from the recycle bin using SOQL.
Note: ALL ROWS keyword cannot be used in the query editor but can be used in the apex class or function while querying record in [].
< < Previous
Next > >
The batch is going to start shortly. Fill the form given below to Register yourself now.
Fill the form below to get a Result
Fill the form below to get a demo of this course.
Online Salesforce Development Course is soon going to be launched. Please fill the form and we will notify you about the course.