HomeGuidesDeveloper HubRelease Notes
Get supportBook a chat
Guides

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.

Available Parameters

These parameters, used by the Partial Expiration batch job, can be found in a custom setting called Point Expiration Settings (api name: FieloPLT__PointExpirationSettings__c). To manage them, go to Setup > Custom Settings > Point Expiration Settings.

Parameters

ParameterTypeDefault (Point / Member)Used By Point ModeUsed By Member ModeDescription
ExecutionMode__cText(50)"Point"N/AN/ANumber of times the batch will automatically be re-executed to expire points when the batch fails. Note: Available in FieloPLT V2.114.69+
MaxAttempts__cNumber10XXNumber of times the batch will automatically be re-executed to expire points when the batch fails.
MaxChain__cNumber20XXNumber of times the batch will automatically be re-executed to expire all points.
QueryLimit__cNumber1000000 / 45000XXNumber of Member records to get from the database to expire their point records
DMLLimit__cNumber2500XNumber of points the batch can expire on each chunk. If not all points are expired, the batch will try again according to the MaxChain__c parameter
BatchSize__cNumber200XXBatch 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)
FromDate__cDatenullXXFrom Date to be used as the first date of the point records to expire
ReferenceDate__cDateTODAYXXDate to replace TODAY's date. Note: Available in FieloPLT V2.114.69+
MaxRange__cNumber200XXNumber of days to get from the database starting from the FromDate__c parameter
SortByMember__cBooleanfalseXXWhen true, the expiration batch will sort all the points by member. This avoids having multiple updates in the same member in one batch execution. Note: Available in FieloPLT V2.114.69+

Example

If you only set the parameter FromDate__c to, for example: 08/15/2022:

  • The batch will try to expire the 2500 (DMLLimit__c) points from the members that are found in the first 45000 point (QueryLimit__c) records from 08/15/2022 to 03/03/2023 (FromDate + 200) (MaxRange__c). But if that leads to updating more than 2500 rows (DMLLimit__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 (MaxAttempts__c)
  • In order to expire all points on that given period, the batch will be automatically executed 20 times (MaxChain__c)
  • The chunks try to expire up to 2500 point records (DMLLimit__c) from of 200 members (BatchSize__c)

Enable Point Based Expiration

Use the following code to enable point based expiration. Execute the following code in Developer Console > Debug > Open Execute Anonynous Window

FieloPLT__PointExpirationSettings__c settings = FieloPLT__PointExpirationSettings__c.getOrgDefaults();
settings.BatchSize__c = 200;
settings.MaxChain__c = 20;
settings.DMLLimit__c = null;
settings.MaxRange__c = 365;
settings.ExecutionMode__c = 'Point';
settings.QueryLimit__c = 1000000;
settings.FromDate__c = null;
settings.ReferenceDate__c = null;
settings.MaxAttempts__c = 15;
settings.SortByMember__c = false;
upsert settings;

Enable Member Based Expiration

Use the following code to enable member based expiration. Execute the following code in Developer Console > Debug > Open Execute Anonynous Window

FieloPLT__PointExpirationSettings__c settings = FieloPLT__PointExpirationSettings__c.getOrgDefaults();
settings.BatchSize__c = 200;
settings.MaxChain__c = 20;
settings.DMLLimit__c = 2500;
settings.MaxRange__c = 365;
settings.ExecutionMode__c = 'Member';
settings.QueryLimit__c = 45000;
settings.FromDate__c = null;
settings.ReferenceDate__c = null;
settings.MaxAttempts__c = 23;
settings.SortByMember__c = true;
upsert settings;

Did this page help you?