Loading
公共部门解决方案文档
目录
选择筛选器

          没有结果
          没有结果
          以下是一些搜索提示

          检查关键字的拼写。
          使用更普遍的搜索词。
          选择更少的筛选器,并扩大搜索范围。

          搜索所有 Salesforce 帮助
          将 Apex 触发器更新为屏幕重新认证应用程序

          将 Apex 触发器更新为屏幕重新认证应用程序

          更新创建福利类别的个人申请记录时运行的 Apex 触发器。配置触发器,以在重新认证申请通过筛选并处于审核状态时发布 BMRecertEvent。BMRecertEvent 的事件处理器会更新与申请相关的福利分配的重新认证状态。

          所需的 Edition

          查看支持的产品版本
          所需用户权限
          更新 Apex 触发器: 作者 Apex
          1. 从“设置”中,在对象管理器中,选择“个人应用程序”。
          2. 单击 ⁇ 触发器
          3. 对于 ProcessIAForBenefitAssistance,单击 操作菜单,然后选择编辑
          4. 将此代码粘贴到文本框。用贵组织中安装的 Omnistudio 软件包的命名空间前缀替换 ⁇ Omnistudio-Namespace-Prefix ⁇ 。
            从“设置”中,在“已安装软件包”页面上查找 Omnistudio 软件包的命名空间前缀。
            trigger ProcessIAForBenefitAssistance on IndividualApplication (after update) {
                String procedureNameForNewIA = 'BenefitManagement_ProcessIndividualApplication';
                Map <String, Object> ipInput = new Map <String, Object> ();
                Map <String, Object> ipOutput = new Map <String, Object> ();
                Map <String, Object> ipOptions = new Map <String, Object> ();
                
                // List to hold the Platform Events to be published
                List<BMRecertEvent__e> eventsToPublish = new List<BMRecertEvent__e>();
                
                // Iterate through the inserted or updated records
                for (IndividualApplication ia : Trigger.new) {
                    if(ia.Status == 'Submitted' && ia.Category == 'Benefit') {
                        String recordId = ia.Id;
                        ipInput.put('RecordId', recordId);
                    
                        /* Call the IP via runIntegrationService, and save the output to ipOutput */
                        ipOutput = (Map <String, Object>) Omnistudio-Namespace-Prefix.IntegrationProcedureService.runIntegrationService(procedureNameForNewIA, ipInput, ipOptions);
                        System.debug('IP Output: ' + ipOutput);
                        IndividualApplication iaRecord = [SELECT Id, Status, ApplicationType, Category FROM IndividualApplication WHERE Id = :ia.Id];
                        if(iaRecord.Status != 'Denied' && iaRecord.ApplicationType == 'Recertification'){
                            BMRecertEvent__e event = new BMRecertEvent__e();
                            
                            // Set fields on the Platform Event based on the inserted or updated record
                            event.RecordId__c = iaRecord.Id;
                            
                            // Add the Platform Event to the list of events to be published
                            eventsToPublish.add(event);
                        }
                    }             
                }
                
                // Publish the list of Platform Events
                if (!eventsToPublish.isEmpty()) {
                    EventBus.publish(eventsToPublish);
                }
            }
          5. 保存更改。
           
          正在加载
          Salesforce Help | Article