화면 재인증 응용 프로그램에 Apex 트리거 업데이트
혜택 범주의 개별 응용 프로그램 레코드가 생성될 때 실행되는 Apex 트리거를 업데이트합니다. 재인증 신청이 선별을 통과하고 검토 중일 때 BMRecertEvent를 게시하도록 트리거를 구성합니다. BMRecertEvent의 이벤트 처리기는 신청과 관련된 보상 할당의 재인증 상태를 업데이트합니다.
필수 Edition
| 지원되는 제품 버전 보기 |
| 필요한 사용자 권한 | |
|---|---|
| Apex 트리거를 업데이트하려면 다음을 수행합니다. | 작성자 Apex |
- 설정의 개체 관리자에서 개별 응용 프로그램을 선택합니다.
- 트리거를 클릭합니다.
-
ProcessIAForBenefitAssistance에서 을 클릭합니다.
을 클릭한 다음 Edit(편집)를 선택합니다.
-
텍스트 상자에 이 코드를 붙여 넣습니다. Omnistudio-Namespace-Prefix를 조직에 설치된 Omnistudio 패키지의 네임스페이스 접두사로 교체합니다.
설정의 설치된 패키지 페이지에서 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); } } - 변경 사항을 저장합니다.
이 기사를 통해 문제를 해결했습니까?
개선을 위한 의견을 보내주세요.

