I have to check User is manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 03:58 AM
Hi,
I have to check User is manager. I have created HR criteria on HR profile table and I have added condition in that HR criteria and I have to add one more condition to check User is manager.
Can anyone please tell how I can check User is manager in this HR Criteria.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:01 AM
Hi,
Try this
answer = checkIfManager();
function checkIfManager(){
var gr = new GlideRecord('sys_user');
gr.addQuery('manager', gs.getUserID());
//gr.addQuery('active', true); //optional
gr.query();
return gr.hasNext();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:06 AM
Hi @Anurag Tripathi,
Thank you so much for your reply.
Can you please tell where should I add above code.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:08 AM
This is the user criteria.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:17 AM
You mean to say that I need to open Related User criteria that is available in HR criteria and I need to add above code.
Please correct me.
Regards,
Nivedita