You need to sign in to do that
Don't have an account?
sekhar maramreddy
to delete contact records through soql query
to delete contact records through soql query
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
You can query for the contacts you want to delete and then you can perform a DML operation on those queried contacts to delete those.
Example : If I want to delete the contacts who are all from finance department below is the code.
Mark this as the best answer if it solves your question.
Yuvaraj
List<Contact> contactsToDel = [SELECT Name FROM Contact WHERE LastName='Smith'];
if ( contactsToDel != null && !contactsToDel.isEmpty() ){
try{
delete contactsToDel;
}
Catch(DmlException e){
// handle exception
}
}
in Developer console, Execute Ananymous Window you can use
delete [SELECT Name FROM Contact WHERE LastName='Smith']