
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2019 02:01 PM
Hi,
Why gliderecord query does not return results while using in client scripts for non-admin users?
e.g.
var group = g_form.getValue('assignment_group');
var user = g_user.userID;
var ir = new GlideRecord('sys_user_grmember');
ir.addQuery('group', group);
ir.addQuery('user', user);
ir.query();
if(ir.next()){
g_form.setValue('assigned_to', user);
alert(ir.sys_id+'if');
}else{
alert(ir.sys_id+'else');
}
- If code runs with admin user logged/ impersonated, it alerts sys_id with 'if' string.
- If code runs with a non admin user logged/ impersonated, it alerts 'undefined' with 'else' string.
PS: I know, we should not use do sync calls to server from client unless required, and also gliderecord should not be used in a client script/ or client side scripts. But I am curious to know the reason, that script behaves differently for admins and non-admins.
Regards,
Anirban
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 09:22 AM
The table glided is on 'sys_user_grmember', however I still tried to test by deactivating the before query BR you mentioned. Did not return result either with non-admin.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 04:29 AM
no, not the case.
You may try the example in personal instance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 04:34 AM
Hi
Check the BR i.e user query which defines the sys_user(User table) only for admin(till kingston version) and for admin,user_admin(From London). Check that query BR.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2019 09:22 AM
The table glided is on 'sys_user_grmember', however I still tried to test by deactivating the before query BR you mentioned. Did not return result either with non-admin.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2019 04:35 AM
That BR mudt be causing this kind of effect.