ScheduledJob__c
Sobject
global class ScheduledJob__c extends SObjectExtends: SObject
Declarative scheduled job configuration. Each record defines a schedulable Apex class, cron expression, and activation status. The trigger framework automatically starts, stops, and monitors jobs based on record changes.
Fields
| Field | Description |
|---|---|
| global String ClassName__c | The fully qualified name of the Apex class to schedule. |
| global String CronExpression__c | Salesforce-format cron expression that defines when this job runs. |
| global String Description__c | Free-text description of the scheduled job purpose and execution frequency. |
| global String ExecutionMode__c | Where this job runs. |
| global Boolean IsActive__c | Activates this scheduled job. |
| global Datetime LastRunAt__c | When this job's most recent run on the job runner finished. |
| global String LastRunJobId__c | The platform job id of the most recent run this job was given on the job runner, written when the run is queued. |
| global String LastRunOutcome__c | What happened at the most recent event on a job that runs on the job runner: Succeeded or Failed from a run, Skipped when a due run was not started because the previous run was still running or the job was inactive when its run began, Parked when the job's class could not be found or its next run time could not be worked out. |
| global String LastRunReason__c | Why the last run was skipped or parked, written by the job runner. |
| global Datetime NextRunAt__c | The next time this job is due on the job runner: the first fire time of its expression, in its time zone, after the check that last started or skipped it. |
| global String OverlapPolicy__c | On the job runner: Skip marks a due run as Skipped while the previous run is still running; Allow starts it anyway. |
| global String Parameters__c | JSON-serialized DTO_NameValues containing name/value pairs passed to the scheduled class at runtime. |
| global Decimal RunPriority__c | Order among jobs due at the same check of the job runner: lower numbers start first, blank goes last. |
| global String ScheduledJobId__c | The Salesforce CronTrigger Id for the scheduled job. |
| global String SchedulerName__c | User-friendly name for this scheduled job, used in the Job Name formula and displayed in Scheduled Jobs setup. |
| global String Timezone__c | IANA TimeZoneSidKey (e.g., Africa/Johannesburg) of the user who authored the cron expression. |
ClassName__c
global String ClassName__cThe fully qualified name of the Apex class to schedule. Supports outer and inner classes (e.g., Namespace.OuterClass.InnerClass).
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(100) |
| Required | true |
| Unique | false |
| External ID | false |
CronExpression__c
global String CronExpression__cSalesforce-format cron expression that defines when this job runs. Uses the 7-field Salesforce cron syntax: Seconds Minutes Hours Day_of_month Month Day_of_week Optional_year.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(255) |
| Required | true |
| Unique | false |
| External ID | false |
Description__c
global String Description__cFree-text description of the scheduled job purpose and execution frequency. Helps administrators understand what the job does without reviewing the code.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text Area |
| Required | false |
ExecutionMode__c
global String ExecutionMode__cWhere this job runs. Its own scheduled job (the default) gives the record one platform scheduled job of its own. Job runner puts the record on the shared runner, which checks it every few minutes and starts it when it is due, costing no scheduled-job slot of its own. Blank means its own scheduled job.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
OwnScheduledJob | Its own scheduled job | Yes |
JobRunner | Job runner | No |
IsActive__c
global Boolean IsActive__cActivates this scheduled job. The framework automatically schedules the job when checked. Automatically unchecked if the job fails or is terminated.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Checkbox |
| Default Value | true |
LastRunAt__c
global Datetime LastRunAt__cWhen this job's most recent run on the job runner finished. Written by the framework.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Date Time |
| Required | false |
LastRunJobId__c
global String LastRunJobId__cThe platform job id of the most recent run this job was given on the job runner, written when the run is queued. The runner reads it to decide whether the previous run is still running.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(18), case-insensitive |
| Required | false |
| Unique | false |
| External ID | false |
LastRunOutcome__c
global String LastRunOutcome__cWhat happened at the most recent event on a job that runs on the job runner: Succeeded or Failed from a run, Skipped when a due run was not started because the previous run was still running or the job was inactive when its run began, Parked when the job's class could not be found or its next run time could not be worked out. Written by the framework.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
Succeeded | Succeeded | Yes |
Failed | Failed | Yes |
Skipped | Skipped | Yes |
Parked | Parked | Yes |
LastRunReason__c
global String LastRunReason__cWhy the last run was skipped or parked, written by the job runner. Blank when the last run succeeded or failed; a failure's detail is in the log entry for this record.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
PreviousRunStillRunning | Previous run still running | Yes |
RecordNoLongerOnRunner | Record no longer on the job runner | Yes |
ClassNotFound | Class not found | Yes |
ExpressionCannotBePlaced | Next run time could not be worked out | Yes |
ExpressionCannotFireWithinHorizon | Expression never fires within four years | Yes |
NextRunAt__c
global Datetime NextRunAt__cThe next time this job is due on the job runner: the first fire time of its expression, in its time zone, after the check that last started or skipped it. Written by the framework; edits to the expression, time zone, mode or active flag reset it.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Date Time |
| Required | false |
OverlapPolicy__c
global String OverlapPolicy__cOn the job runner: Skip marks a due run as Skipped while the previous run is still running; Allow starts it anyway. A skipped run is not made up later.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
Skip | Skip this run while the previous one is still running | Yes |
Allow | Allow runs to overlap | No |
Parameters__c
global String Parameters__cJSON-serialized DTO_NameValues containing name/value pairs passed to the scheduled class at runtime. The scheduled class must implement IF_Schedulable to receive these parameters.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Long Text Area(131072) |
RunPriority__c
global Decimal RunPriority__cOrder among jobs due at the same check of the job runner: lower numbers start first, blank goes last. A preference, not a guarantee; when a check has more due jobs than it may start, a low priority can wait.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(5,0) |
| Required | false |
| Unique | false |
| External ID | false |
ScheduledJobId__c
global String ScheduledJobId__cThe Salesforce CronTrigger Id for the scheduled job. System-populated when the job is scheduled.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(18), case-insensitive |
| Required | false |
| Unique | true |
| External ID | false |
SchedulerName__c
global String SchedulerName__cUser-friendly name for this scheduled job, used in the Job Name formula and displayed in Scheduled Jobs setup.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(40) |
| Required | true |
| Unique | false |
| External ID | false |
Timezone__c
global String Timezone__cIANA TimeZoneSidKey (e.g., Africa/Johannesburg) of the user who authored the cron expression.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(100) |
| Required | false |
| Unique | false |
| External ID | false |