- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2019 04:02 AM
Hi,
Can anyone help me in getting the sys_id of the logged in user on the service portal?
I'm creating a catalog client script and I need to get the sys_id of the currently logged in user but g_user.userID(); isn't working. Will I need to use GlideAjax here?
Any help would be great.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2019 04:12 AM
Use g_user.userID (without brackets). This should work in client scripts
Ex:
var user = g_user.userID;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2019 04:43 AM
userID is a property and not a method which is why we dont use ().
For more information have a look at these links -