- 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 11:22 PM
Thank you for your tip!
- 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 11:26 PM
Bingo! That is what I want to achieve in one line.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2018 11:22 PM
after using this
gs.getUser().getUserByID(gs.getUser().getManagerID())
solution
the output is like com.glide.sys.User@cb0590
not the managerId
so how to get ManagerID or Name ??
please explain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2024 12:57 PM
I tried to get manager's manager full name in Vancouver:
gs.getUser().getUserByID(gs.getUser().getUserByID(gs.getUser().getRecord().getValue('manager')).getManagerID()).getFullName()