Configure a Scheduled Job in Salesforce
Fullcast Scheduler is a custom Scheduler job that has the ability to update a field in a Salesforce object. It has the ability to filter the records and update targeted records. The Fullcast scheduler contains two components.
- is set up by setting the Scheduler Job Frequency
- maximum is one hour duration
- in Apex jobs page Fullcast Scheduler Batch Schedule is the Scheduled Job .
- is setup using Fullcast Scheduler object records.
- when the Fullcast Scheduler runs then you should see the batch job Fullcast Scheduler Batch.
- Not every scheduled job needs to spin up a batch. But we can control if the batch job needs to run batch on the frequency set in the fullcast scheduler (custom object) record.
In Salesforce, a batch job can be run directly or could be scheduled.
Activating Fullcast Scheduler Job
- Log into the Salesforce Account, and click on the Setup.
- In the Quick Find search, type Custom metadata types and click Manage records against Fullcast Policy settings.
- Select Scheduler Job Frequency.
- Click edit to set the Field value. This Field Value is the time gap that needs to be set for the scheduler to run. For example, if the field value set is 15 minutes, then the scheduler will run every 15 mins. Set the required field value and save.
Scheduler Job frequency
60 minutes is the maximum that can be set for the Scheduler job frequency.
Activating Batch Job
- Click on Fullcast Jobs in the App Launcher.
- Click New to create a Fullcast batch job.
- Enter the Details of the Fullcast Batch job, with the following the general guidelines/definitions below:
- Job Name: Enter the Name of Batch job here.
- Object Name: Enter the Object (Account, Lead, Contacts) where the Spark Field and the Filter Field are located.
- Filter Field: This would be the Field that the Scheduler looks at to pull only the records that need to be sparked.
- Filter Operator: Select an operator from the drop-down list: Equal To, Not Equal To, Contain, etc.
- Filter Field Value: This would be the Value in the Filter Field that the scheduler looks at to filter records for spark.
- Spark Field: This is the API name of the field that the Spark Field Value should get stamped in.
- Spark Field Value: Value to be stamped in a text field. This stamps the Date Time with the text in this field.
- Execute Policy: Choose None. If scheduling for Holdout policy, then Choose Holdout Policy.
- Enabled: Check this box field to enable the Scheduler.
- Start Time: When to start the scheduler.
End Time: When to end the scheduler.
- Frequency (in minutes): This is how often the scheduler will run, choose desired frequency.
- Batch Size: This is the number of records being processed, and could be anywhere from 1-200. For running heavy processes on certain objects, it is ideal to keep the batch size very small from 5-10 for better results.
- Save the document after updating the required fields.
- Check the box against the job name and click Start Scheduler to enable the job whenever necessary.
- Check the box against the job name and click Abort Scheduler to enable the job whenever necessary.