- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 05:23 AM
Hi Guys,
I am trying to get a sys_user record.
When I request the user record from admin it works.
When I try to do the same thing it doesn't get.
I am running GlideRecord from BusinessRule.
Any help is appreciated.
Regards
Yusuf
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:47 AM
Hello,
Kindly, check the read access controls for the "sys_user" table. As per my understanding you are trying to say the user record is accessible from an admin account but not for any other role.
Verify the below access control on user table and Check if required roles are added to these access control :
- Read. none
- Read .*
If this is appropriate , try to debug your business rule by adding log statements.
You can also try to use impersonation script to debug in background script :
session.onlineImpersonate("skarke1990@gmail.com");
var gr = new GlideRecord('sys_user');
gr.get(usersysid);
gr.query();
if(gr.next()){
gs.print('debug statement'+gr.email);
}
session.onlineUnimpersonate();
Please mark helpful if its useful information for you
Cheers !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:22 AM
No getRefRecord(),
var user = new GlideRecord("sys_user");
if (user.get("user_sys_id")) {
//If I try with a user with admin role it comes here otherwise it doesn't
user.email = "new email address";
user.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 05:42 AM
hi,
1>check the user is inactive
2>yes user is inactive then Activate the user
3>check ur script is correct or not
Thanks,
Rahul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:18 AM
Yes user is inactive, but works from admin role account

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:23 AM
what exactly have you written?
if any script you have used then paste it here so we can try to check that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:24 AM
It is a pretty straitforward code,
var user = new GlideRecord("sys_user");
if (user.get("user_sys_id")) {
//If I try with a user with admin role it comes here otherwise it doesn't
user.email = "new email address";
user.update();
}