You are here:
Monitor and Run Batch Jobs for Sample Limit Triggers
Sample limit trigger handlers use batch jobs to automate the processing of large volumes of records. Track the status and health of sample limit batch jobs, and reprocess records if the batch jobs fail.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise and Unlimited Editions with Life Sciences Cloud, Life Sciences Cloud for Customer Engagement Add-on license, and the Life Sciences Customer Engagement managed package. |
| User Permissions Needed | |
|---|---|
| To create, edit, and delete Life Sciences Cloud data: | Life Sciences Commercial Admin permission set |
| To use the Developer Console: | API Enabled AND View All Data |
If a batch job fails for one of these trigger handlers, review the batch job and batch job part records to get details about the failures.
- CalculateShippedQuantityHandler
- NewAccountSampleLimitInitHandler
- NewAccountSampleLimitInitHandlerforHCO
Then, you can reprocess the failed records so the sample limits are created or updated.
- From the Setup menu, open the Developer Console.
- Select Debug, and then select Open Execute Anonymous Window.
-
To reprocess records created or updated via the CalculateShippedQuantityHandler trigger
handler, enter this Apex code. In
sampleIds, replace the example set of Provider Visit Requested Sample record IDs with your own.Set<Id> sampleIds = new Set<Id> { '001XXXXXXXXXXXXAA4', '001XXXXXXXXXXXXAA4' }; Map<String, Object> paramMap = new Map<String, Object>(); paramMap.put('action', 'updateSampleLimitsWithShippedQuantity'); paramMap.put('providerVisitRqstSampleIds', sampleIds); LifeScienceApi.getInstance(LifeScienceApi.Command.SampleLimitsJobService).execute(paramMap); -
To reprocess records created or updated via the NewAccountSampleLimitInitHandler or
NewAccountSampleLimitInitHandlerforHCO trigger handlers, enter this Apex code. In
accountIds, enter the IDs of the accounts to process and initialize sample limits for.Set<Id> accountIds = new Set<Id> { '001XXXXXXXXXXXXAA4', '001XXXXXXXXXXXXAA4' }; Map<String, Object> paramMap = new Map<String, Object>(); paramMap.put('action', 'initializeSampleLimitsForNewAccounts'); paramMap.put('accountIds', accountIds); LifeScienceApi.getInstance(LifeScienceApi.Command.SampleLimitsJobService).execute(paramMap); -
Click Execute.
Executing the Apex code invokes the trigger handlers to reprocess the records. If the batch job fails again, failures are logged in new batch job and batch job part records.
Did this article solve your issue?
Let us know so we can improve!

