UI Action Client Script assistance please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 10:24 AM
Hello,
I have added this code to an existing UI Action client script because I need to ensure that when the user selects a Type of Correction Requested that is added after the initial submission, that those fields will be required. To further clarify, if the user initially selected the Term for the account when submitting the case and then needs to go back and add another type of correction requested like backdating, there is another field that displays dynamically that the user has to fill in before clicking the Resubmit button. My script below is requiring the user to complete all of the fields even though they were not added to the form. I should only be validating fields that are on the form to ensure they are filled in. I know it is probably something stupid, but I would appreciate some assistance please?
This needed to be added to the UI Action client script because it also goes onto display a modal that the user completes before the resubmit can be completed. Doing it any other way doesn't ensure the fields are completed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 10:32 AM
If I understand the scenario correctly, I think you are saying that the variables you're checking are not always visible, so you want to only check the ones that are visible. If that is correct, then you need to add a condition to all the variables you're setting. For example, instead of doing this:
var reqTermForAcctEmpty = g_form.getValue('exception_for_term_account') === '';
You would need to do something like this:
var reqTermForAcctEmpty = true;
if({whatever your condition is for showing the variable})
var reqTermForAcctEmpty = g_form.getValue('exception_for_term_account') === '';
You would do that for all 4 variables. Then the default would be true, but if any of them are required and empty, they would be set to false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 10:49 AM
Thanks Jennifer, so I believe my conditions would be something like the following:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 11:40 AM
You can't check a system property from a client script, so that's not going to work, if that's your criteria. A variable on a form should be required based on other variables on that form, not on system properties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 09:59 AM
Hi Jennifer,
Thank you again for the assist. I have come up with the script below which has the condition of recognizing the type of correction requested and the associated field that cannot be empty. It almost works as when the applicable fields get added to the form based on the type of correction requested and they are empty, it shows the correct error message. Then once i fill in the empty values for the fields, i get this error message of "The following mandatory fields are not filled in: (and it is blank afterwards). Once the fields are no longer empty and I click the Resubmit UI Action, it should be popping up a modal box for user input and allowing them to finish resubmitting. If you don't mind and have a few minutes to review my code below, can you see if you see the reason this is happening please?