Points Expiration Custom Parameters
To aid in high-volume implementations, there are some parameters that you as an admin can configure in order for the Partial Expiration batch job to remain within Salesforce governor limits when the number of Point records in the database grows very large.
Add Available Parameters
These parameters don't come out of the box with the FieloPLT package. You as an admin need to create them in the Custom Setting called FieloPLT.PublicSettings__c so that the Partial Expiration batch job can make use of them.
The parameters are custom fields that you can add to the FieloPLT.PublicSettings__c custom setting. To include them, go to Setup > Custom Settings, navigate to Public Settings in the FieloPLT namespace, and add the custom fields listed below. Be sure that the API names, field types and default values match what is listed below.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| PointExpirationMaxAttempts__c | Number | 10 | Number of times the batch will automatically be re-executed to expire points when the batch fails. |
| PointExpirationMaxChain__c | Number | 20 | Number of times the batch will automatically be re-executed to expire all points. |
| PointExpirationQueryLimit__c | Number | 45000 | Number of Member records to get from the database to expire their point records |
| PointExpirationDMLLimit__c | Number | 2500 | Number of points the batch can expire on each chunk. If not all points are expired, the batch will try again according to the PointExpirationMaxChain__c parameter |
| PointExpirationBatchSize__c | Number | 200 | Batch size of the batch execution. It means it will go expiring the points in chunks of 200 (default) members. It can lead to many point records to be expired (more than 200, because it will be like 200 * [Point Records] (Point Records = Number of point records the member has) |
| PointExpirationFromDate__c | Date | null | From Date to be used as the first date of the point records to expire |
| PointExpirationMaxRange__c | Number | 200 | Number of days to get from the database starting from the PointExpirationFromDate__c parameter |
Example
If you only set the parameter PointExpirationFromDate__c to, for example, 08/15/2022:
- The batch will try to expire the 2500 (
PointExpirationDMLLimit__c) points from the members that are found in the first 45000 point (PointExpirationQueryLimit__c) records from08/15/2022to03/03/2023(FromDate + 200) (PointExpirationMaxRange__c). But if that leads to updating more than 2500 rows (PointExpirationDMLLimit__c) the batch will continue expiring those points in the next execution. - If one or more chunks fail, the batch will try again 10 times (
PointExpirationMaxAttempts__c) - In order to expire all points on that given period, the batch will be automatically executed 20 times (
PointExpirationMaxChain__c) - The chunks try to expire up to 2500 point records (
PointExpirationDMLLimit__c) from of 200 members (PointExpirationBatchSize__c)
Updated about 1 year ago
