画面再証明アプリケーションへの Apex トリガーの更新
カテゴリ Benefit の個々のアプリケーション レコードが作成されたときに実行される Apex トリガーを更新します。再証明アプリケーションが審査を通過して審査中の場合に BMRecertEvent を公開するようにトリガーを設定します。BMRecertEvent のイベントハンドラーは、申請に関連する給付割り当ての再認定状況を更新します。
必要なエディション
| サポートされている製品のエディションを表示する。 |
| 必要なユーザー権限 | |
|---|---|
| Apex トリガーを更新する | 「Apex 開発」 |
- [設定] のオブジェクトマネージャーで、[ Individual Application] を選択します。
- [Triggers] をクリックします。
-
ProcessIAForBenefitAssistance で、[
] をクリックし、[編集] を選択します。
-
テキストボックスに次のコードを貼り付けます。「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); } } - 変更を保存します。
この記事で問題は解決されましたか?
ご意見をお待ちしております。

