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
thomsantthomsant 

Apex Scheduler --Very urgent

Hi All I am trying run the scheduler every minuter and it does not seem to run and and not able to see the instance in the logs . Is there any we need to start the scheduler /or any other setting needs to be done . How will this scheduler be called ? Help really appreciated ., below is the code Tom global class Scheduled_Account_Migrate { global void execute(SchedulableContext SC) { Migrate_Account_Class_Batch Acc = new Migrate_Account_Class_Batch(); // Acc.setPCAccount(); String sch = '0 * * * * * *'; system.schedule('Merge Job', sch, Acc); } }
Best Answer chosen by Admin (Salesforce Developers) 
Andy BoettcherAndy Boettcher

thomsant - once you submit the scheduler job via System Log, that is a "one-and-done" activity, unless you need to modify the code that is being executed.  If you need to modify your code, you need to delete the job, edit your code, and re-run the scheduler code from System Log.

 

If you need to stop the job for whatever reason, you can delete the schedule from Setup -> Monitoring -> Scheduled Jobs.

 

Does that help?

All Answers

Richa KRicha K

Hi Tom,

 

Two things,

1 - Are you executing the scheduler triggering code line from System log? This is important.

  If not, please execute this in your system log -

   String sch = '0 * * * * * *'; 
   system.schedule('Merge Job', sch, Acc);
2- You cannot run your scheduler peer minute by the code above because you can't use '*' in minute place. For this to happen, you have to use some different way. May be triggering more than one schedulers. :)

 

Thanks,

Shailesh Patil

thomsantthomsant
Thanks shailesh , Actually i did not know that i need to set it up from the system log ,I am doing this for the first time and also i am pretty new to SFDC... So if i set it up once in the system log will it run continuously? and in production is this a one time activity ? and how can we stop this once it has been triggered to run every hour. Pls let me know Tom
Chamil MadusankaChamil Madusanka

Refer : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

Andy BoettcherAndy Boettcher

thomsant - once you submit the scheduler job via System Log, that is a "one-and-done" activity, unless you need to modify the code that is being executed.  If you need to modify your code, you need to delete the job, edit your code, and re-run the scheduler code from System Log.

 

If you need to stop the job for whatever reason, you can delete the schedule from Setup -> Monitoring -> Scheduled Jobs.

 

Does that help?

This was selected as the best answer
ziaullahkhaksarziaullahkhaksar

delete the job first and then try to Modify ur class 

i.e.

Setup -> Monitoring -> Scheduled Jobs-> Click Delete Against you Job Name that u have scheduled.

hope it will work.