function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anil MeghnathiAnil Meghnathi 

I want to set start and end date of schedule job

I want to set start and end date of schedule job using apex code.

Cron Trigger has StartTime,EndTime fields but they are not writable.

How to set start and end date.

 

Any idea???

 

Thanks

Anil

SFDC_EvolveSFDC_Evolve

I believe You cant get the Starttime of the Schedule Job .   

 

 

Thanks

SFDC_Evolve

 

cropzimcropzim

The method System.schedule should do the trick

 

System.schedule('my job name',MY_CRON_EXP,new MySchedulableClass())

 also see http://en.wikipedia.org/wiki/Cron#CRON_expression

 

You can launch this from a button that connects to a VF controller or, what I do, is launch by execute anonymous APEX in the developer console