Loading
Feature degradation | Gmail Email delivery failureRead 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
          Run Affiliation ‌Batch Apex Jobs

          Run Affiliation ‌Batch Apex Jobs

          Run batch Apex jobs from the Developer console to automate tasks such as setting affiliation types, creating reciprocal affiliations, and establishing primary affiliations between accounts and parent organizations. Track the status and health of your batch Apex jobs and terminate them from Setup when necessary.

          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

          Before you run the AffiliationDataLoadProcessorBatcha batch job, turn off the HardAffiliationHandler and the AffiliationReciprocalHandler trigger handlers. Before you run the AccountPrimaryAffiliationBatch batch job, turn off the HealthcareProviderAffiliationHandler trigger handler.

          Run the batch Apex job using this Apex code: Map<String, Object> paramMap = new Map<String, Object>{ 'batchName' => '{your_batch_name}', 'batchSize' => '{your_batch_size}', 'isCreatedByCurrentUser' => '{your_is_created_by_current_user_boolean}', 'createdAfter' => '{your_datetime}', 'whereClause' => '{your_where_clause_string}' }; // Call Boolean result = (Boolean)(lsc4ce.LifeScienceApi.getInstance(lsc4ce.LifeScienceApi.Command.AffiliationBatchJob).execute(paramMap)); System.debug('Result: ' + result);
          The batchSize, createdAfter, isCreatedByCurrentUser, and whereClause parameters are optional. For instructions on how to run batch Apex jobs, see Executing Anonymous Apex Code.
          Example
          Example Map<String, Object> paramMap = new Map<String, Object>{ 'batchName' => 'AffiliationDataLoadProcessorBatch', 'batchSize' => 200, 'isCreatedByCurrentUser' => true, 'createdAfter' => Datetime.newInstance(2025, 8, 1, 0, 0, 0), 'whereClause'=> 'AffiliationStrengthType = \'High\'' }; // Call Boolean result = (Boolean)(lsc4ce.LifeScienceApi.getInstance(lsc4ce.LifeScienceApi.Command.AffiliationBatchJob).execute(paramMap)); System.debug('Result: ' + result);

          This code runs the AffiliationDataLoadProcessorBatch job, setting the batch size to 200. It processes only the records that were created by the logged in user on the 1st of August 2025 at 0 hours. It executes the records with the affiliation-strength type as high.

           
          Loading
          Salesforce Help | Article