- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 02:42 PM
Hi Developers
I am trying to achieve the below. When a user changes the Forecasted date then the fields "Reason for change, Category and Sub category" should become visible on the form and mandatory. I was able to configure the requirement to make the field mandatory when user changes the Forecasted date. But how can I hide these fields from the form initially?
Please the code below:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 05:31 AM
@BiancaK Try writing a ui policy to hide all the field initially. Then update your if condition for above code share by me as
if (oldValue != '' && oldValue != newValue)
…………………………………………..
Mark it helpful 👍and Accept Solution ✅!! If this helps you to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 04:04 PM
I would hide them either using your code
g_form.setVisible('u_reason_for_change', false);
g_form.setMandatory('u_reason_for_change', false);
in an onLoad client script, or in a UI Policy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 09:50 PM
Thanks Alex, yes I need to hide it as a first requirement and then second requirement is to make it visible only when the forecasted date changes. The forecasted date is not empty.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 08:48 PM
@BiancaK Please create a UI Policy with a condition which checks if Forecasted date is empty. In the UI Policy Action make the u_reason_for_change Mandatory false and Visble False.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 09:54 PM
Hi @Sandeep Rajput thank you. I had a UI policy but it is not working.
Here are the steps from the start.
1. On a new form the Forecasted date will be completed and the form is saved, so the Forecasted date will never be empty.
2. Then at a later stage the user decides to change this Forecasted date, at this time when they are attempting to change the Forecasted date the Reason for change field should only appear on the form and be mandatory to provide a reason why they want to change the Forecasted date.