Is it possible to mark fields on an Application as “conditionally required”? There is one field on my application that determines what “type” of record it is, and I have other fields that I want to visibly show as required but only when the record is in a certain state.
For example, say I have FieldA hooked up to a List Lookup. There are fields FieldB and FieldC on the application. If FieldA is one List Lookup value, I want FieldB to be required, while if FieldA is the other value, I want FieldC to be required.
Asked Ed, and it sounds like there is a way to do it using a Logic Block and a Style Definition. Here is the AI response:
To set up a field that is only required when a different field has a given value, you can use the Style Definition and Logic Block Builder. Here’s how you can configure this:
Steps to Configure Conditionally Required Fields:
-
Create a Style Definition:
- Navigate to the Style Definitions application.
- Create a new record.
- Select “Field” in the
StyleTypefield. - Select the
StyleConditionallyPopulatedcheckbox.
-
Use Logic Block Builder to Apply Styles:
- Open the Logic Block Builder.
- Add an “Apply Styles” action.
- Select the appropriate application and field.
- Enter the name of your style definition created in the previous step.
- Define the condition under which the field should be required. For example, if you want the “Phone Number” field to be required only when the “Contact Method” field is set to “Phone”, you would set up the logic to check the value of “Contact Method” and apply the required style to the “Phone Number” field accordingly.
Example Configuration:
-
Style Definition Record:
StyleType: FieldStyleConditionallyPopulated: Checked
-
Logic Block:
- Condition: If
ContactMethod== “Phone” - Action: Apply Styles
- Application: YourApplicationName
- Field: PhoneNumber
- StyleDefinition: YourStyleDefinitionName
- Condition: If
This configuration ensures that the “Phone Number” field becomes required only when the “Contact Method” field has the value “Phone”.
2 Likes