You need to sign in to do that
Don't have an account?
yaramareddy radhika
System.StringException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented. I am getting this error for below code?
This is the batch Apex class which i am reffering in schedule apex class
==========================================================
global class BatchApexUpdate implements Database.Batchable<Sobject>{
global string qe=[select Id,description from Account];
global Database.QueryLocator start(Database.BatchableContext bc){
return Database.getQueryLocator(qe);
}
global void execute(database.BatchableContext bc,List<Account> scope){
for(Account a:scope){
a.Description='Batch Test';
a.Industry='sunderinfotech';
}
update scope;
}
global void finish(Database.BatchableContext bc){
OutboundEmail1 ob= new OutboundEmail1();
ob.send();
}
}
Schedule Apex class
====================
public class ScheduleExamp2 implements Schedulable{
public void execute(SchedulableContext sc){
BatchApexUpdate ba= new BatchApexUpdate();
}
}
Execution code in anonymous window
===============================
ScheduleExamp2 se=new ScheduleExamp2();
string cron='0 0 16 2 1 2 2017';
ID jobid=system.schedule('batchapex', cron,se );
while executing this i am getting above error.
==========================================================
global class BatchApexUpdate implements Database.Batchable<Sobject>{
global string qe=[select Id,description from Account];
global Database.QueryLocator start(Database.BatchableContext bc){
return Database.getQueryLocator(qe);
}
global void execute(database.BatchableContext bc,List<Account> scope){
for(Account a:scope){
a.Description='Batch Test';
a.Industry='sunderinfotech';
}
update scope;
}
global void finish(Database.BatchableContext bc){
OutboundEmail1 ob= new OutboundEmail1();
ob.send();
}
}
Schedule Apex class
====================
public class ScheduleExamp2 implements Schedulable{
public void execute(SchedulableContext sc){
BatchApexUpdate ba= new BatchApexUpdate();
}
}
Execution code in anonymous window
===============================
ScheduleExamp2 se=new ScheduleExamp2();
string cron='0 0 16 2 1 2 2017';
ID jobid=system.schedule('batchapex', cron,se );
while executing this i am getting above error.
1) http://amitsalesforce.blogspot.com/2016/02/batch-apex-in-salesforce-test-class-for.html
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
Let us know if above will help you
NOTE:- you need to pass 6 param but you was passing the 7
1) http://www.chiragmehta.info/chirag/2009/11/12/salesforce-schedule-apex-to-run-at-any-time-interval/
2) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
Issue is coming because you can not pass the both a day-of-week AND a day-of-month parameter.
So your exp can be below
Or