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
AladinCGAladinCG 

Set Start and End Date of Cron Trigger using Apex Code

Hi,
I have created one VF page which allows users to create schedule on Daily, Weekly and Monthly basis, which is working perfectly fine, now I am trying to add option of Start Date and End Date for all schedule i.e. I want to give ability to user that he/she can start schedule on specific day and can end on specific day for e.g. the Schedule is Daily, Start Date is 01/Jan/2015 and End Date is 05/Feb/2015 then the schedule must be executed for 36 times (01 Jan to 05 Feb) and after 05th Feb the schedule must be terminated
If anyone knows how to do this using Apex please help me
Thanks
Nirav
Iqrar AhmedIqrar Ahmed
Hi Nirav,

Use apex scheduler to acheive this here is documentation
 http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

Regards