You need to sign in to do that
Don't have an account?

Class Sample_Contactupdate_Batch must implement the method: System.Iterable<Contact> Database.Batchable<Contact>.start(Database.BatchableContext)
I have implemented the start method but still am getting above error.
below is my code. could anyone explain me.
global class Sample_Contactupdate_Batch implements Database.batchable<Contact> {
global database.QueryLocator start(Database.BatchableContext jobid)
{
String query='select id,name,DOB__c from Contact where createdDate<=180' ;
return database.getQueryLocator(query);
// we can query upto 50 million records
}
global void execute(Database.BatchableContext jobid,list<Contact> scope)
{
List<Contact> ctc=new List<Contact>();
//Contact c=new Contact();
for(Contact c:scope)
{
c.DOB__c=system.today+200;
ctc.add(c);
}
update ctc;
}
global void finish(database.BatchableContext jobid)
{
}
}
below is my code. could anyone explain me.
global class Sample_Contactupdate_Batch implements Database.batchable<Contact> {
global database.QueryLocator start(Database.BatchableContext jobid)
{
String query='select id,name,DOB__c from Contact where createdDate<=180' ;
return database.getQueryLocator(query);
// we can query upto 50 million records
}
global void execute(Database.BatchableContext jobid,list<Contact> scope)
{
List<Contact> ctc=new List<Contact>();
//Contact c=new Contact();
for(Contact c:scope)
{
c.DOB__c=system.today+200;
ctc.add(c);
}
update ctc;
}
global void finish(database.BatchableContext jobid)
{
}
}
global database.QueryLocator start(Database.BatchableContext jobid)
{
String query='select id,name, DOB__c from Contact where createdDate<=180' ;
return database.getQueryLocator(query);
// we can query upto 50 million records
}
global void execute(Database.BatchableContext jobid,list<Contact> scope)
{
List<Contact> ctc=new List<Contact>();
//Contact c=new Contact();
for(Contact c:scope)
{
c.DOB__c = system.date.today()+200;
ctc.add(c);
}
update ctc;
}
global void finish(database.BatchableContext jobid)
{
}
}
global string jsonString=API_Test_PSE.Str;
global Object[] start(Database.BatchableContext BC) {
List<API_Wrapper> amcleads = (List<API_Wrapper>) JSON.deserialize(jsonString, List<API_Wrapper>.class);
return amcleads;
// return (API_Wrapper[])JSON.deserialize(jsonString, List<API_Wrapper>.class);
}
global void execute(Database.BatchableContext context, List<API_Wrapper> scope) { //API_Wrapper[]
// Do stuff here
}
global void finish(Database.BatchableContext context) {
}
}
==========================================================
Class BatchPSE must implement the method: System.Iterable<API_Wrapper> Database.Batchable<API_Wrapper>.start(Database.BatchableContext)================>>>>please help me,why im getting this error....