- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 06:00 PM
Hi everyone,
If possible can I please get some expertise on what might be causing a conflict with my catalog client script. Attached and below are the details. I have duplicated this in my pdi and it is working as expected and making the field mandatory. However, when this is in our dev instance it is not making the field required. I checked the other ui policies to see if there is a conflict but I'm not finding anything. I really didn't want to have to recreate everything and was curious if there was a way to determine why it isn't working in my dev instance.
thank you in advance for any feedback you can provide!
//Karen has the role PM and mandatory fields are not required for her
//PM role also displays visiblity to modules
//Users with PMSubmitter role will be required to complete Mandatory fields
function onLoad() {
// if (g_user.hasRole('pmsubmitter')){
if (g_user.hasRoleExactly('pmsubmitter')){
// g_form.setDisplay('effort_estimate', false);
// g_form.setMandatory('business_need', false);
g_form.setMandatory('business_need', true);
}
else{
// g_form.setDisplay('effort_estimate', true);
// g_form.setMandatory('business_need', true);
g_form.setMandatory('business_need', false);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 06:32 PM
I can observe few points:
When using the Service Portal, please choose "All" as the UI type instead of "desktop."
If there are numerous client scripts on the form, deactivate them all by setting "Active" to "False." Test if your client script functions correctly this way. Then, activate them one by one to identify the problematic one.
Ensure that the user has the "pmsubmitter" role.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 07:31 PM - edited 08-21-2023 07:31 PM
Hello @Prince Arora
I took your advice and made the following changes as you suggested but still have no luck.
changed "All" as the UI type instead of "desktop."
There were 2 other client scripts and I marked them inactive. Marked each one inactive, tested and even with both inactive still having an issue
ensured my test users have the new role "pmsubmitter". I even created a new role pm_user, added it to the script and added access to the user and no luck.
Do you have any other ideas. I have several ui policies and business rules but they all appear to look good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:14 AM
Thanks everyone for the feedback. I moved the change to my test instance and the script below worked perfectly. I believe some of the following changes I've made in dev our causing a conflict. Just wanted to share in case anybody else is having the issue. thanks again for all the help!!