- 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 05:37 AM
Is the user record inactive?
There's a business rule that doesn't allow inactive users to come back in query so in your script you'd need to add something like:
gr.setWorkflow(false);
where gr is the variable for whatever you're using in your glide.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:19 AM
I tried every option including this one.
Still no good.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 07:26 AM
If the user is inactive, as you've said in the other post below, then this will work...where are you placing that option?
You'd need to do this:
var user = new GlideRecord("sys_user");
user.setWorkflow(false);
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();
}
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2019 05:39 AM
Yusuf,
It is hard to answer this question without contextual examples. Can you provide the code snippet for review? If not, I suspect your issue is related to an incorrect GlideElementmethod in your Business Rule. Are you using getRefRecord() to return the referenced sys_user record?
Thanks,
Derrick Johnson