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
davidjbbdavidjbb 

Scheduler

Hello,

 

Is there a way to create records of a object based on a certain time ? For example, if it's 12am the Work Order object will create X number(X number depends) of Work Orders based on the time? Any tips or feedback on how to get this going would be most appreciated.

 

Cheers,

Davidjbb

Navatar_DbSupNavatar_DbSup

Hi,

 

You have to simply write all the logic inside the schedule class. It’s like a simple class that implement scheduling and you have to write all the logic inside the execute method.

 

Try the below code as reference:

 

global class getStockPrice implements Schedulable

{

global void execute(SchedulableContext ctx)

{

// put for logic here.

}

}

 

 

For more detail follow the below link:

 

 

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

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.