+ Start a Discussion
vanessa veronvanessa veron 

Problem: create a job schedulable

HI...
I tested create a job schedulable:

It work:
... for example:

String sch = '0 28 15 * * ?'
system.schedule('NomJobSchedulable' , sch, p);

String sch = '0 28 15 1,2,3,4-20,31 1,3,4,6 ?'
system.schedule('NomJobSchedulable' , sch, p);

It DONT work:
... for example:

String sch = '0 28 15 * * MON-FRI'
system.schedule('NomJobSchedulable' , sch, p);

All the different value ? I informe for day-of-week does not work.
Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.

Why?
Thank you
Best Answer chosen by vanessa veron
Sfdc CloudSfdc Cloud
? is only available for Day_of_month and Day_of_week, and is generally used when specifying a value for one and not the other.
You cant use both a day-of-week AND a day-of-month parameter at the same time
String notation would be
(String sch = seconds + ‘ ‘ + minutes + ‘ ‘ + hours + ‘ ‘ + dayOfMonth + ‘ ‘ + month + ‘ ‘ + dayOfWeek + ‘ ‘ + year;)
 
You can Refer below link for various example..
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
http://www.chiragmehta.info/chirag/2009/11/12/salesforce-schedule-apex-to-run-at-any-time-interval/

If this answer will  helps,please mark it as best answer to help other out 

All Answers

Sfdc CloudSfdc Cloud
? is only available for Day_of_month and Day_of_week, and is generally used when specifying a value for one and not the other.
You cant use both a day-of-week AND a day-of-month parameter at the same time
String notation would be
(String sch = seconds + ‘ ‘ + minutes + ‘ ‘ + hours + ‘ ‘ + dayOfMonth + ‘ ‘ + month + ‘ ‘ + dayOfWeek + ‘ ‘ + year;)
 
You can Refer below link for various example..
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
http://www.chiragmehta.info/chirag/2009/11/12/salesforce-schedule-apex-to-run-at-any-time-interval/

If this answer will  helps,please mark it as best answer to help other out 
This was selected as the best answer
vanessa veronvanessa veron
Thank you very much...

The best, the top...