运行关联 批量 Apex 作业
从开发人员控制台运行批处理 Apex 作业,以自动化任务,例如设置关联类型、创建相互关联以及在客户和父组织之间建立主要关联。跟踪批处理 Apex 作业的状态和健康程度,并在必要时从“设置”中终止它们。
所需的 Edition
| 适用于:Lightning Experience |
| 适用于:具有Life Sciences Cloud、Life Sciences Cloud for Customer Engagement加载项许可证和Life Sciences Customer Engagement受管软件包的Enterprise 和 Unlimited Edition。 |
| 所需用户权限 | |
|---|---|
| 创建、编辑和删除 Life Sciences Cloud 数据: | 生命科学商业管理员权限集 |
在运行 AffiliationDataLoadProcessorBatcha 批处理作业之前,请关闭 HardAffiliationHandler 和 AffiliationReciprocalHandler 触发器处理器。在运行 AccountPrimaryAffiliationBatch 批处理作业之前,请关闭 HealthcareProviderAffiliationHandler 触发器处理程序。
使用此 Apex 代码运行批处理 Apex 作业:
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);
batchSize、createAfter、isCreatedByCurrentUser 和 whereClause 参数是可选的。有关如何运行批量 Apex 作业的说明,请参阅执行匿名 Apex 代码。
示例
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);此代码运行 AffiliationDataLoadProcessorBatch 作业,将批次大小设置为 200。它仅处理登录用户在 2025 年 8 月 1 日 0 时创建的记录。它执行关联强度类型为高的记录。
本文章是否解决您的问题?
请与我们共享您的想法,以便我们进行改进!

