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
jvalotojvaloto 

Schedule a apex in Post Install Script

Hello,

 

I have my package and a Schedulable class, I want to create a Schedule job in a Post Install Script.

 

Anybody can help me?

HariDineshHariDinesh

Hi,

 

What do you mean by Post install script?

What is your exact question, you want to create a schedule for a schedulable class which is in package?

Is it the question (at least as per my understanding).

 

If it is so you can schedule the class using Schedule apex button in Apex class list.

And you can schedule using Crone expression also.

 

EX:

 

NameSpace.classname ce = new  NameSpace.classname();
 String sc = '0 11 1 2 * ?';
 system.schedule('myyyy', sc , ce);

 

 

G2WIntegrationG2WIntegration

Jvaloto - use InstallHandler to wake up the scheduled job.

 

Details on install handler w/ code samples:

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