Scheduling Apex jobs
To schedule an apex job hourly, fill in <ClassName> with the name of the class to be scheduled and <description> then run the following code in execute anonymous (see previous section).
String schedule = '0 0 * * * ?'; //This is hourly
String description = <description>; // The description shown when viewing job status and what is scheduled.
System.schedule(description,schedule, new <ClassName>());
The schedule string uses 6 numbers separated by spaces to define the schedule. They are, in order,
Seconds Minutes Hours Day_of_month Month Day_of_week
The special character * means every as in every hour, every day, every
month. ? means no value and is only available for day of month and day
of week.
For help scheduling, visit Salesforce's Apex Scheduler developer documentation.
The tables below list available apex schedulable jobs, their recommended schedule, and how to run them on demand.
| Class name | Interval | Schedule string | On demand |
|---|---|---|---|
| MED_AnonymizerBatch | Hourly | '0 0 * * * ?' | Database.executeBatch(new mvn.MED_AnonymizerBatch()); |
| MED_NetworkRetrieveDCRBatchSched | Hourly | '0 0 * * * ?' | Database.executeBatch(new mvn.MED_NetworkRetrieveDCRBatchSched(),50); |
| MED_NetworkSendDCRBatchSched | Hourly | '0 0 * * * ?' | Database.executeBatch(new mvn.MED_NetworkSendDCRBatchSched(),50); |
| MED_QAFlagCasesBatch | Monthly | '0 0 0 0 * ?' | Database.executeBatch(new mvn.MED_QAFlagCasesBatch(),1); |
| MED_VeevaMIRFPullBatchSched | Hourly | '0 0 * * * ?' | Database.executeBatch(new mvn.MED_VeevaMIRFPullBatchSched(),1); |
| MED_VeevaMIRFUpdateBatchSched | Hourly | '0 0 * * * ?' | Database.executeBatch(new mvn.MED_VeevaMIRFUpdateBatchSched(),1); |
| MED_VeevaMIRFPullLocalSched | Hourly | '0 0 * * * ?' | Database.executeBatch(new mvn.MED_VeevaMIRFPullLocalSched(),1); |
| MED_VeevaMIRFUpdateLocalSched | Hourly | '0 0 * * * ?' | (new mvn.MED_VeevaMIRFUpdateLocalSched()).execute(null); |
| Class name | Job name | Interval | Schedule string |
|---|---|---|---|
| mvn.CM_ScheduledPublishJob | CM_Scheduled_Publish_Job_1 | Hourly | '0 0 * * * ?' |
| mvn.CM_ScheduledPublishJob | CM_Scheduled_Publish_Job_2 | Hourly | '0 10 * * * ?' |
| mvn.CM_ScheduledPublishJob | CM_Scheduled_Publish_Job_3 | Hourly | '0 20 * * * ?' |
| mvn.CM_ScheduledPublishJob | CM_Scheduled_Publish_Job_4 | Hourly | '0 30 * * * ?' |
| mvn.CM_ScheduledPublishJob | CM_Scheduled_Publish_Job_5 | Hourly | '0 40 * * * ?' |
| mvn.CM_ScheduledPublishJob | CM_Scheduled_Publish_Job_6 | Hourly | '0 50 * * * ?' |
| mvn.CM_ExpiredDocumentsSchedulable | CM_Expired_Documents_Job_1 | Hourly | '0 0 * * * ?' |
| mvn.CM_ExpiredDocumentsSchedulable | CM_Expired_Documents_Job_2 | Hourly | '0 10 * * * ?' |
| mvn.CM_ExpiredDocumentsSchedulable | CM_Expired_Documents_Job_3 | Hourly | '0 20 * * * ?' |
| mvn.CM_ExpiredDocumentsSchedulable | CM_Expired_Documents_Job_4 | Hourly | '0 30 * * * ?' |
| mvn.CM_ExpiredDocumentsSchedulable | CM_Expired_Documents_Job_5 | Hourly | '0 40 * * * ?' |
| mvn.CM_ExpiredDocumentsSchedulable | CM_Expired_Documents_Job_6 | Hourly | '0 50 * * * ?' |
| mvn.CM_UpcomingDocumentExpirationSchedulable | CM_Upcoming_Document_Expiration_Job | Hourly | '0 0 * * * ?' |
| mvn.CM_CacheSObjectMetadataSchedulable | CM_Cache_Task_Metadata_Job | Monthly | '0 0 * * * ? ' |
| CM_CancelExpiredCheckedOutDocumentsBatch | CM_CancelExpiredCheckedOutDocumentsBatch | Daily | '0 0 * * * ?', |
| mvn.CM_CheckOutExpirationSchedulable | CM_CheckOutExpirationSchedulable | Daily | '0 0 * * * ?', |