I have set up a schedule task as per instructions here: To turn the scheduling on, I open a dev console and do:

MY_NS.MyScheduleTask = new MY_NS.MyScheduleTask ();
String sch = '35 27 15 1 3 ?';
System.Schedule('MyScheduleTask', sch, p);

However, if I packing my code I don't want users to have to run this code from the dev console. Instead, I like a system administrator to just turn it on. Is it possible to do this?


If it is apex scheduling you want to do without doing it from code, you'll have to go to:

  1. Your Name -> Setup
  2. App Setup -> Develop -> Apex Classes
  3. Schedule Apex button at the top
  4. Here you can manually schedule an apex class which implemented the Schedulable interface

enter image description here enter image description here

| improve this answer | |
  • can't see this. What privileges do I need? – dublintech Mar 1 '13 at 17:40
  • I can't seem to find any specific permissions, so i'd guess you just need the permission to create apex. I checked in over 10 orgs, ranging from developer, to partner developer, enterprise, force.com, ... and everywhere I seem to have access to the button – pjcarly Mar 1 '13 at 20:04
  • by the way: perhaps you looked next to it, the button is in the same row as "Run All Tests", I have added a screenshot to my answer, please check it out – pjcarly Mar 1 '13 at 20:08

It is just Apex code. I don't see why you couldn't make it part of a controller action somewhere that functions off of a button click. That should work fine.

| improve this answer | |
  • Agreed, you could create a quick VF UI to wrap around the Apex logic and then buttons to enable it, or even to delete it. – joshbirk Mar 1 '13 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.