- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2015 05:12 PM
I can get the manager by "javascript:gs.getUser().getRecord().getDisplayValue('manager')". Then, I tryed "javascript:gs.getUser().getRecord().getValue('manager').getRecord().getDisplayValue('manager')" to get manager of the manager. But it doesn't work. How can I get manager of the manager?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2015 10:49 PM
The biggest issue I've encountered with the gs.getUser() object, is that the values obtainable within are not necessarily up to date. The values were current when the user's session was created, but if they change during the session, they are no longer all that useful. In that case, you would want to use a glide record such as the one Kalai has used above with some checking to avoid a potential missing manager or 2. Otherwise, the correct syntax is:
gs.getUser().getUserByID(gs.getUser().getManagerID()).getManagerID();
//breaking it down further...
//get a user object for the current user
gs.getUser()
//change the user object from the current user to their manager
gs.getUser().getUserByID(gs.getUser().getManagerID())
//get the manager id of that user object (i.e. user's manager's manager)
gs.getUser().getUserByID(gs.getUser().getManagerID()).getManagerID();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2015 08:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2015 10:06 PM
I'd like to get manager of the manager. I tryed "gs.getUser().getManagerID().getManagerID()". But it returns nothing.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2015 10:14 PM
That wont work. Do a gliderecord query on sys_user record and get the value. You can dot walk like above in that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2015 10:20 PM
Try this
var getUserData = new GlideRecord('sys_user');
if(getUserData.get(gs.getUserID()))
{
gs.log(getUserData.manager.manager);
}