You need to sign in to do that
Don't have an account?
Sushmitha Anabthula
i'm trying to delete candidates using batch apex but couldn't perform
public class BatchApex implements database.Batchable<sobject>
{
public database.QueryLocator start(database.BatchableContext bc)
{
String q ='select id from Candidate__c';
Return database.getQueryLocator(q);
}
public void execute(database.BatchableContext bc, list<Candidate__c> can)
{
delete can;
}
public void finish(database.BatchableContext bc)
{
}
}
{
public database.QueryLocator start(database.BatchableContext bc)
{
String q ='select id from Candidate__c';
Return database.getQueryLocator(q);
}
public void execute(database.BatchableContext bc, list<Candidate__c> can)
{
delete can;
}
public void finish(database.BatchableContext bc)
{
}
}
Please include the error message that you are seeing.
Sharing this sample code that deletes account records.
Run the below in the anonymous block
This code will delete the account records provided there are no dependencies(associated cases with the account)
If this information helps, please mark the answer as best. Thank you