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 |
-
Create an apex file that retrieves the roles from the Applicant.Role picklist.
- In Setup, in the Quick Find box, enter Apex Classes, and then select Apex Classes.
- Click New.
-
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; } } - Save your changes.
-
Update the DigitalLendingAdditionalApplicants OmniScript.
- In App Launcher, select OmniStudio, and then select OmniScripts.
- Click DigitalLendingAdditionalApplicants.
- Click New Version.
- Expand AdditionalApplicants step.
- Click $standardLabel.DigitalLendingAdditionalApplicants.Role.
- In the Properties panel, select Custom for Option Source.
- In the Source field, enter CoApplicantRoles.getCoApplicantRoles.
-
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.
Did this article solve your issue?
Let us know so we can improve!

