- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 12:32 PM
Hi everyone,
I have the following Catalog Client Script to make a field mandatory if a user has a specific role.
function onLoad(){
var user = g_user.hasRole('it_security');
if(user == true){
g_form.setMandatory('risk_comments_1',true);
g_form.setMandatory('sec_rating_1',true);
}
}
For some reason it is not making the field mandatory even though the user does have the role. I have another script to make the same fields read only if the user does not have that role, and that one is working just fine.
Any help is appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 02:01 PM
ok the first thing i would do is disable all other client scripts and ui policies on the item... then see if it works right.. if so you have a conflict..enalble them one at a time and see which one breaks your client script and why.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 12:42 PM
Can you please try
- function onLoad(){
- if(g_user.hasRole('it_security')){
- g_form.setMandatory('risk_comments_1', true);
- g_form.setMandatory('sec_rating_1', true);
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 01:04 PM
Unfortunately that did not make a difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 02:01 PM
ok the first thing i would do is disable all other client scripts and ui policies on the item... then see if it works right.. if so you have a conflict..enalble them one at a time and see which one breaks your client script and why.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 07:21 AM
Thanks! I found what was causing the issue!