- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:13 AM - edited 03-22-2023 02:18 AM
Hi,
We have a record producer's reference variable where you select a user from table [sn_hr_core_profile] (with 0 filter meaning ALL users, even inactive ones are listed). This record producer is in application/scope "Human Resources: Core".
That user's info is then auto-filled with:
- onChange catalog client script
- which also has a GlideAjax to a script include, where we have a GlideRecord query to get the details, then feed it back as return new global.JSON().encode(j_obj).
For users who are active, this works without issues. I added g_form.addInfoMessage to the onChange script and it returns me valid JSON with correct values:
var resp = response.responseXML.documentElement.getAttribute("answer");
g_form.addInfoMessage('var resp: ' + resp); //returns null for Inactive users
However, we also have a need to have the same functionality for users who's [sys_user] record is active=false and locked_out=true.
Question:
Is there some hidden built-in functionality that limits script include's GlideRecord('sn_hr_core_profile') to only work for users who are Active? For active users, everything is working well, but for inactive/locked out users, it does not. No custom limitations have been put in place to limit this.
var user = this.getParameter('usr');
var gr = new GlideRecord('sn_hr_core_profile');
//gr.get(user);
gr.addQuery('sys_id', user);
gr.query();
if (gr.next()) {
gs.info('gr.user.name: ' + gr.user.name.toString() + '\n' + 'gr.user.title.toString(): ' + gr.user.title.toString()); //returns empty values for Inactive users
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:29 AM
Hi Henri,
There happens to be a Query BR on user table named user query. Did you check that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:29 AM
Hi Henri,
There happens to be a Query BR on user table named user query. Did you check that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:57 AM - edited 03-22-2023 02:58 AM
Yes, you are correct. There is an OOB before Query BR named "user query", which is limiting inactive users, if you are non-admin user. Thanks JaspalSingh!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:51 AM
Problem seems to be the Business Rule that blocks the access to non admin/user admin roles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:58 AM - edited 03-22-2023 02:58 AM
Yes, you are correct. There is an OOB before Query BR named "user query", which is limiting inactive users. Thanks Jake!
