Skip to content

ScheduledJob__c ​

Sobject

apex
global class ScheduledJob__c extends SObject

Extends: 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 ​

FieldDescription
global String ClassName__cThe fully qualified name of the Apex class to schedule.
global String CronExpression__cSalesforce-format cron expression that defines when this job runs.
global String Description__cFree-text description of the scheduled job purpose and execution frequency.
global String ExecutionMode__cWhere this job runs.
global Boolean IsActive__cActivates this scheduled job.
global Datetime LastRunAt__cWhen this job's most recent run on the job runner finished.
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.
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.
global String LastRunReason__cWhy the last run was skipped or parked, written by the job runner.
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.
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.
global String Parameters__cJSON-serialized DTO_NameValues containing name/value pairs passed to the scheduled class at runtime.
global Decimal RunPriority__cOrder among jobs due at the same check of the job runner: lower numbers start first, blank goes last.
global String ScheduledJobId__cThe Salesforce CronTrigger Id for the scheduled job.
global String SchedulerName__cUser-friendly name for this scheduled job, used in the Job Name formula and displayed in Scheduled Jobs setup.
global String Timezone__cIANA TimeZoneSidKey (e.g., Africa/Johannesburg) of the user who authored the cron expression.

ClassName__c ​

apex
global String ClassName__c

The fully qualified name of the Apex class to schedule. Supports outer and inner classes (e.g., Namespace.OuterClass.InnerClass).

Field Attributes:

AttributeValue
Data TypeText(100)
Requiredtrue
Uniquefalse
External IDfalse

CronExpression__c ​

apex
global String CronExpression__c

Salesforce-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:

AttributeValue
Data TypeText(255)
Requiredtrue
Uniquefalse
External IDfalse

Description__c ​

apex
global String Description__c

Free-text description of the scheduled job purpose and execution frequency. Helps administrators understand what the job does without reviewing the code.

Field Attributes:

AttributeValue
Data TypeText Area
Requiredfalse

ExecutionMode__c ​

apex
global String ExecutionMode__c

Where 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:

AttributeValue
Data TypePicklist
Requiredfalse

Picklist Values:

API NameLabelActive
OwnScheduledJobIts own scheduled jobYes
JobRunnerJob runnerNo

IsActive__c ​

apex
global Boolean IsActive__c

Activates this scheduled job. The framework automatically schedules the job when checked. Automatically unchecked if the job fails or is terminated.

Field Attributes:

AttributeValue
Data TypeCheckbox
Default Valuetrue

LastRunAt__c ​

apex
global Datetime LastRunAt__c

When this job's most recent run on the job runner finished. Written by the framework.

Field Attributes:

AttributeValue
Data TypeDate Time
Requiredfalse

LastRunJobId__c ​

apex
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. The runner reads it to decide whether the previous run is still running.

Field Attributes:

AttributeValue
Data TypeText(18), case-insensitive
Requiredfalse
Uniquefalse
External IDfalse

LastRunOutcome__c ​

apex
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. Written by the framework.

Field Attributes:

AttributeValue
Data TypePicklist
Requiredfalse

Picklist Values:

API NameLabelActive
SucceededSucceededYes
FailedFailedYes
SkippedSkippedYes
ParkedParkedYes

LastRunReason__c ​

apex
global String LastRunReason__c

Why 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:

AttributeValue
Data TypePicklist
Requiredfalse

Picklist Values:

API NameLabelActive
PreviousRunStillRunningPrevious run still runningYes
RecordNoLongerOnRunnerRecord no longer on the job runnerYes
ClassNotFoundClass not foundYes
ExpressionCannotBePlacedNext run time could not be worked outYes
ExpressionCannotFireWithinHorizonExpression never fires within four yearsYes

NextRunAt__c ​

apex
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. Written by the framework; edits to the expression, time zone, mode or active flag reset it.

Field Attributes:

AttributeValue
Data TypeDate Time
Requiredfalse

OverlapPolicy__c ​

apex
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. A skipped run is not made up later.

Field Attributes:

AttributeValue
Data TypePicklist
Requiredfalse

Picklist Values:

API NameLabelActive
SkipSkip this run while the previous one is still runningYes
AllowAllow runs to overlapNo

Parameters__c ​

apex
global String Parameters__c

JSON-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:

AttributeValue
Data TypeLong Text Area(131072)

RunPriority__c ​

apex
global Decimal RunPriority__c

Order 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:

AttributeValue
Data TypeNumber(5,0)
Requiredfalse
Uniquefalse
External IDfalse

ScheduledJobId__c ​

apex
global String ScheduledJobId__c

The Salesforce CronTrigger Id for the scheduled job. System-populated when the job is scheduled.

Field Attributes:

AttributeValue
Data TypeText(18), case-insensitive
Requiredfalse
Uniquetrue
External IDfalse

SchedulerName__c ​

apex
global String SchedulerName__c

User-friendly name for this scheduled job, used in the Job Name formula and displayed in Scheduled Jobs setup.

Field Attributes:

AttributeValue
Data TypeText(40)
Requiredtrue
Uniquefalse
External IDfalse

Timezone__c ​

apex
global String Timezone__c

IANA TimeZoneSidKey (e.g., Africa/Johannesburg) of the user who authored the cron expression.

Field Attributes:

AttributeValue
Data TypeText(100)
Requiredfalse
Uniquefalse
External IDfalse