gs.getUser().getRecord() Not the same as GlideRecord('sys_user') ??
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2013 08:12 AM
Hi All,
I'm getting different results on two things I thought were essentially interchangeable.
var usrID = gs.getUserID();
var gr = new GlideRecord('sys_user');
if(gr.get(usrID)) {
gs.print(gr.getValue('u_default_group'));
}
OUTPUT: 6f028386d0aea0007f0059dfebc05518
var gr = gs.getUser().getRecord();
gs.print(gr.getValue('u_default_group'));
OUTPUT: nullThe 'u_default_group' field is the only field we've added to the table that doesn't work, but it's also the only reference field we've added.
I know
gs.getUser().getRecord()returns a 'GlideMemoryRecord' not a 'GlideRecord' but is there a reason why this specific field doesn't work?
Thanks in advance
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2013 08:43 AM
If you log out and back in, does it work? Perhaps the GlideMemoryRecord gets cached at login.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2013 09:23 AM
Thanks once again CapaJC!
I did not know that it was cached.
