only Manager should be able to submit the catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hello Everyone,
Currently I'm working on a scenario where a Manager can only request for Catalog item and no other person can request.
Example: My name is John and my managers name is Mitchell, then in this case only my manager to whom I report should be the only one who can request for this item for me. Suppose there is one more Manager whose name is Lisa and I don't report to her, in that case even if she tries to submit for me, then it shouldn't happen. She should not be able to submit a request for me.
for this I wrote Script Include & Catalog OnSubmit script:
SI:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
you should always write onChange catalog client script on variable "requested_for" and if validation fails throw error on that variable.
This ensures that form gets submitted with valid details.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
This is not the best approach, best approach is to make catalog item visible for managers and let them submit on behalf of their reportees, you can create simple user criteria and write below code.
answer = checkIfManager();
function checkIfManager(){
var gr = new GlideRecord('sys_user');
gr.addQuery('manager', gs.getUserID());
gr.query();
return gr.hasNext();
}
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
then show only those users in requested_for users which are direct reportees of the logged in user
use advanced ref qualifier as this in that variable
javascript: 'manager=' +gs.getUserID();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader