Loading
Public Sector Documentation
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
          Create a Trigger to Screen Benefit Applications

          Create a Trigger to Screen Benefit Applications

          Create a trigger to call an Integration Procedure when an individual application record is created for a benefit applicant assessment application. The Integration Procedure performs basic screening on the application, such as checking whether the participants named in the application are U.S. citizens. If the application fails the screening, then the Integration Procedure denies the application. If the application passes, then the Integration Procedure queues it for caseworkers to review.

          Required Editions

          View supported product editions.
          User Permissions Needed
          To define Apex triggers: Author Apex
          1. From Setup, in Object Manager, select Individual Application.
          2. Click Triggers and then click New.
          3. On the Version Settings tab, click Select to Add Installed Package and then select Omnistudio.
          4. On the Apex Trigger tab, select is active.
          5. In the text box, paste the following code. Replace Omnistudio-Namespace-Prefix with the namespace prefix of the Omnistudio package installed in your org.
            Find the namespace prefix of the Omnistudio package on the Installed Packages page in Setup.
            trigger ProcessIAForBenefitAssistance on IndividualApplication (after update) {
                String procedureName = '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> ();
                
                for (IndividualApplication ia: trigger.new) {
                   
                    /* Populating input map for an Integration Procedure. Follow whatever structure your VIP expects */
                    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(procedureName, ipInput, ipOptions);
                    
                        System.debug('IP Output: ' + ipOutput);
                    }
                }
            }
          6. Save your changes.
           
          Loading
          Salesforce Help | Article