Loading
Salesforce now sends email only from verified domains. Read More
Help Agent Performance DegradationRead More
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Monitor and Run Batch Jobs for Sample Limit Triggers

          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.

          1. From the Setup menu, open the Developer Console.
          2. Select Debug, and then select Open Execute Anonymous Window.
          3. 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);
          4. 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);
          5. 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.
           
          Loading
          Salesforce Help | Article