+ Start a Discussion
ismyhcismyhc 

How to package an app that has a scheduled batch job ?

Im in the process of packaging our code so that a client of ours can start testing our app. One of the processes invloved in our app is a scheduled job that happens once a day. Ive been just setting up cron through the "system log" so far while in development mode... like soo...

 

       

system.schedule('Advertiser Batch Job', sch, m);
scheduleAdvertiserBatch m = new scheduleAdvertiserBatch();
String sch = '0 56 10 * * ?';

 

 

How would I package something like this? Or will the client have to schedule the batch job manually?

 

Thanks!
Jacob Davis 

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

Create a custom configuration page (e.g. /apex/namepace__appsetup ), and have the administrator click a button to run the code. There isn't yet a "run on install" mechanism like you would have with a desktop-based installation program, so this is probably the ideal approach for now.

 

Edit: You can set up a Web Tab or Visualforce Tab for the configuration; they could remove/hide the tab after they've used it. Or, you could even make it a splash page for a certain tab.

All Answers

sfdcfoxsfdcfox

Create a custom configuration page (e.g. /apex/namepace__appsetup ), and have the administrator click a button to run the code. There isn't yet a "run on install" mechanism like you would have with a desktop-based installation program, so this is probably the ideal approach for now.

 

Edit: You can set up a Web Tab or Visualforce Tab for the configuration; they could remove/hide the tab after they've used it. Or, you could even make it a splash page for a certain tab.

This was selected as the best answer
ismyhcismyhc

Perfect.

 

This is will work just fine!

 

Thanks!