Client script to make variables mandatory- after submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2023 07:14 PM
Hi everyone,
I am trying to make variables mandatory after the request has been submitted, if the user has the pmsubmitter rule and if a custom field additional information is set to yes. I'm attempting to do this with a client script (below and attached) . Below is the script I am trying and attached are the results. When I impersonate a user after the request has been submitted, with the pmsubmitter role the platform is showing a black * instead of red indicating the field is required. In addition, the user that submits the request needs to be able to show these variables as required on the portal after summitted and their manager selects Yes at additional information. Unfortunately the variables are not getting set as required on the portal. Is this possible? In the past I've utilized sctasks and a flow to achieve. Below
Thank you in advance for any guidance you can provide!
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (g_user.hasRoleExactly("pmsubmitter"))
if (newValue === 'Yes') //yes
g_form.setMandatory('test1', true);
else
g_form.setMandatory('test1', false);
}
this but the requirement is to simply use the ritm for all the data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2023 06:43 AM
Why not use a Catalog UI Policy?
Check these fields, and you should be good to go:
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.