gs.getUserID() is not working ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2019 01:52 AM
Hi Developers,
I have a table as u_shift_allowances_temp and there are 20 records and i want to fetch no.of records which are assigned to "assigned_to" members.
for this i wrote
var rca_table=new GlideRecord("u_shift_allowances_temp");
rca_table.addQuery("u_assigned_to",'00b6ea5edbabba80189d73200f96197b');
rca_table.addQuery('u_state', 'CONTAINS', 'Rejected');
rca_table.query();
while(rca_table.next())
{
gs.print("print:" + rca_table.getDisplayValue('u_assigned_to'));
}
In above query , 2nd line if i will write
rca_table.addQuery("u_assigned_to",gs.getUserID());
It's not fetching any data instead if i will give sys_id of that user, its fetching the data .
Please suggest me what to do here, because i cann't give one sys_id because i want to show the reject records who has uploaded that.
Regards,
Manmath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2019 02:37 AM
ideally gs.getUserID() should work but try gs.getUserID()+'' instead of gs.getUserID()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2021 03:33 AM
I am having somewhat same issue. I want the user sys id of currently logged in user.
And the requirement is I want it on server side i.e. in Script Include.
I am trying this:
var user_name = gs.getUserName();
var userSysId = gs.getUserID();
But in both the case, it only returns system. But expected results are different.
So how to get correct username and userID on server side in script include.
It will be great help as it is blocking me.
Thanks in advance.
Kaushal