- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:15 AM
I am trying to populate a form with the logged in user manager email. I can get the manager name using the manager ID but I am have a little bit of challenge getting the manager email address.
I found this article to get manager of manager. I tried to tweak it without any luck.
How can you get manager of manage of logged-in user as default value?
gs.getUser().getUserByID(gs.getUser().getManagerID()).getManagerID();
Any guidance or direction greatly appreciated.
thanks
Alex
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:18 AM
Hi Alex,
You will need to call a glide record for this, the below should work.
var manager = new GlideRecord('sys_user');
manager.get(gs.getUser().managerID);
manager.email
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:38 AM
var manager = new GlideRecord('sys_user');
manager.get(gs.getUser().managerID);
manager_email=manager.email;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:18 AM
Hi Alex,
You will need to call a glide record for this, the below should work.
var manager = new GlideRecord('sys_user');
manager.get(gs.getUser().managerID);
manager.email
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:25 AM
Hey Chris - do I put manger.email; on the third line?
(I am very new to this)
thanks
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:28 AM
Hi Alex,
The email address will be stored as manager.email, you only need the first 2 lines to get the details from the manager profile, then you will set whichever field you need to update to the value.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:35 AM
I may have this script in the wrong place.
I put the codes under the variable Manager Email default value tab. The same place where I pull user information. Does this needs to go to different place?
I am on jakarta version.
thanks
alex