Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 11:39 PM
hi there
we have a requirement where if the user's manager title is 'base lead' then restrict user visiblitiy to the catalog item.
i am using the below in 'not available for'
is the below code ok
Thanks
Levino
checkCondition();
function checkCondition(){
var user = new GlideRecord('sys_user');
user.get(gs.getUserID());
if (user.manager.title=='BASE LEAD')
{
return true;
}
return false;
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 11:47 PM
Hello,
Always try in Available for criteria, avoid it in not available for criteria, try this ?
checkCondition();
function checkCondition(){
var gr = new GlideRecord("sys_user");
gr.addQuery("manager.title", '!=' ,'name of title');
gr.query();
if(gr.hasNext()
return true;
else
return false;
}
Please hit like and mark my response as correct if that helps
Regards,
Musab
Regards,
Musab
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2022 11:47 PM
Hello,
Always try in Available for criteria, avoid it in not available for criteria, try this ?
checkCondition();
function checkCondition(){
var gr = new GlideRecord("sys_user");
gr.addQuery("manager.title", '!=' ,'name of title');
gr.query();
if(gr.hasNext()
return true;
else
return false;
}
Please hit like and mark my response as correct if that helps
Regards,
Musab
Regards,
Musab