- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 06:07 AM
Heya!
I'm trying to set the default value of a reference variable on a catalog item. The reference variable is referencing users with a certain role in our organization, leaders/managers have this role.
I've tried gs.getUser().getManagerID() but I get no value? I can confirm that the user has a manager.
Thanks,
goller
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 06:15 AM - edited ‎10-20-2022 06:16 AM
Hi @goller
If you are doing this in scoped application it will not work.
Instead you can use below:
javascript: var loggedinManager;
var gr=new GlideRecord("sys_user");
gr.get(gs.getUserID());
loggedinManager=gr.manager.toString();
loggedinManager;
Hope it helps
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 06:15 AM - edited ‎10-20-2022 06:16 AM
Hi @goller
If you are doing this in scoped application it will not work.
Instead you can use below:
javascript: var loggedinManager;
var gr=new GlideRecord("sys_user");
gr.get(gs.getUserID());
loggedinManager=gr.manager.toString();
loggedinManager;
Hope it helps
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 06:56 AM
Thank you so much, this worked like a charm!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 06:20 AM
Hi,
You can try below:
gs.getUser().getRecord().getValue('manager')
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 07:01 AM
This did not work, probably because I am in a scoped application as Murthy Ch mentioned.