Technical Articles
How to dynamically control a field behavior on a custom screen
Hello community,
I would like to share with you how to define a dynamic behavior of a custom field within your custom screens.
On this example, we will be creating a calculation rule to control a field visibility based on another field from a custom EC, since the ability of creating an UI rule for a custom screen while on Adaptation Mode is not possible.
The business requirement for my case is to display the Expiration Date field on the UI only when the Contract Expired field has a value (equals true).
Once you have your Embedded Component created, you need to select the field which will be dynamically controlled (Expiration Date on this case) and navigate to Properties tab.
In the Properties tab, under Behavior – ColumnVisible property, select Advanced:
In the Dependent Property Editor window, select the Calculation Rule option and define a formula similar to the below one:
You can be using every field that is defined in the DataModel from your UI component. These fields are listed on the Invalidation Trigger section on the bottom.
Once this is done, mark each of the fields on the Invalidation Trigger which you have used used on the formula and add it using the arrow buttons. Then click OK and save and activate the screen.
Hope you found this helpful!
Thiago