Loading
Ongoing maintenance for Salesforce HelpRead More
Feature degradation | Gmail Email delivery failureRead More
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
          Customize the Co-Applicant Application

          Customize the Co-Applicant Application

          Customize the Role picklist values on the co-applicant screen. Use Apex Class to remove the picklist value Primary.

          Required Editions

          Available in: Lightning Experience

          Available in: Professional, Enterprise, and Unlimited Editions

          User Permissions Needed
          To set up Digital Lending:

          Digital Lending permission set

          1. Create an apex file that retrieves the roles from the Applicant.Role picklist.
            1. In Setup, in the Quick Find box, enter Apex Classes, and then select Apex Classes.
            2. Click New.
            3. Enter the Apex Class.
              The Apex class returns all Role values except Primary Applicant.
              global with sharing class CoApplicantRoles implements Callable
              {
                  // Dispatch actual methods
                 public Object call(String action, Map<String, Object> args) {
                     
                     Map<String, Object> input = (Map<String, Object>)args.get('input');
                     Map<String, Object> output = (Map<String, Object>)args.get('output');
                     Map<String, Object> options = (Map<String, Object>)args.get('options');
              
                     return invokeMethod(action, input, output, options);
                 }
              
                  private Object invokeMethod(String methodName, Map<String, Object> inputMap, Map<String, Object> outMap, Map<String, Object> options) 
                  {
                      if(methodName.equals('getCoApplicantRoles')) {
                          // this returns the applicant roles
                          return GetCoApplicantRoles(inputMap, outMap);
                      }   
              
                      return null;
                  }
                   
                  /**
                   * Get applicant role, excluding Primary Applicant value
                   * @param inputMap input 
                   * @param outputMap output from Apex
                   * @return outputMap output from Apex to IP
                   */
                  public Object getCoApplicantRoles(Map<String, Object> inputMap, Map<String, Object> outputMap) {
                      List<Map<String, Object>> optionList = new List<Map<String, Object>>();
                      
                      for (PicklistValueInfo role : [SELECT Label,value FROM PicklistValueInfo WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Applicant' AND EntityParticle.DeveloperName = 'Role' and isActive = true]) {
                          if (!'Primary Applicant'.equals(role.Value)) {
                              Map<String, Object> option = new Map<String, Object>();
                              option.put('name', role.Value);
                              option.put('value', role.Label);
                              optionList.add(option);
                          }
                      }
                      outputMap.put('options', optionList);
                      return optionList;
                  }
              }
            4. Save your changes.
          2. Update the DigitalLendingAdditionalApplicants OmniScript.
            1. In App Launcher, select OmniStudio, and then select OmniScripts.
            2. Click DigitalLendingAdditionalApplicants.
            3. Click New Version.
            4. Expand AdditionalApplicants step.
            5. Click $standardLabel.DigitalLendingAdditionalApplicants.Role.
            6. In the Properties panel, select Custom for Option Source.
            7. In the Source field, enter CoApplicantRoles.getCoApplicantRoles.
            8. Click Activate Version.
              When you activate a new version of an OmniScript, the active version is automatically used in place of the non-active versions.
           
          Loading
          Salesforce Help | Article