11. Adding Form Rules
It is possible to control the visibility of the fields in a form based on the value that a user selects by inserting Form Rules into the appropriate attribute of an object. In our practice, if the Employment Type is set to Self-Employed or Retired then the field Employer will be hidden.
- Navigate to Setup → Case Setup → Case Types
- Open the Auto Loan Data Model.
- In the Forms Builder, open the Employer form
- Click the Edit Form Rules. It will open a pop-up window to add the rules.
- Click the Add Rule button. Select Standard Rule
- Enter ‘Hide Employer Name’ for the Name.
- Select Any from the If dropdown list.
- In the Conditions section select Employment Type(1) – Contains(2) – Self-Employed(3) and then click the green plus button (4) to add this condition.
- Add a new condition for the Retired option. Select Employment Type(1) – Contains(2) – Retired(3) and then click the green plus button to add this condition.
- In the Actions section, select Hide(1) – Employer(2) and then click the green plus button (5) to add this action.
- Add a new Standard Rule and name it ‘Show Employer Name’.
- Add the following Conditions:
- Employment Type – Not Contains – Self-Employed
- Employment Type – Not Contains – Retired
- Add the Action: Show – Employer.
- Compare your screen with the following image.
- Apply the rule to the form and then test it using the Preview option.
Next Steps
12. Linking Forms and Detail Pages