Configuring Scheduled SFM Batch Apex Chaining
The scheduling of a high volume of records can sometimes result in a Salesforce CPU time limit exception. This can be resolved by using the Salesforce Batch Apex Chaining feature. The Batch Apex Chaining feature splits the records into multiple jobs creating a chain of queueable jobs. To achieve this, you must manually create a custom setting.
* 
If the custom setting is configured, only then the Batch Apex Chaining feature is applied to the records.
To create a custom setting:
1. Go to ServiceMax Setup > App Administration> Settings.
2. Select Module: SFM Transaction Manager; Submodule: Scheduled SFM Engine.
3. On the Custom Settings section, click New Setting. Enter the values for the fields as described below:
a. Setting Id: SET001
b. Setting Name: Number of records to be processed in one batch
c. Data Type: Number
d. Setting Type: Global
e. Search Order: Global
4. Click Save.
To activate the custom setting:
1. Go to ServiceMax Setup> App Administration > Configuration Profiles.
2. Under the Org-wide Configuration Settings, select the relevant profile and click Edit.
3. Select Module: SFM Transaction Manager; Submodule: Scheduled SFM Engine.
4. Click Edit for the SET00100 custom setting and enter the number of records per batch. For example, if 500 records are to be processed and the setting value is 100. Then five batch jobs of 100 records each are executed in each batch job run. These jobs are run one after another.
5. Click Save. Click Close.
6. Click Quick Save on the Edit Configuration Profile page.
7. Click Refresh on the Enter Values for Settings section.
8. Click Save on the Edit Configuration Profile page.
* 
One email notification per batch is sent to the configured email id on successful execution of the Scheduled SFM process. For example, if five batch jobs are executed, then five email notifications are sent.
A Scheduled SFM process is partially executed when there are no slots available in the Apex Flex Queue to execute the remaining batch jobs. An email notification with the Partially Complete status is sent to the configured email id. It is recommended to re-run the Scheduled SFM with the appropriate criteria to execute only the non-processed records.
Was this helpful?