Query Inactive users in scriptInclude from ALM_HARDWARE table(Dot-walking)

Harsha M V
Tera Contributor

Hi All,

I am passing sys_id of the user which was fetched in the client script to below script includes and storing it in variable called userID.

 

For admins, In this query its fetching the records correctly for both active and inactive. But if user is inactive the data is not getting fetched for non-admins through catalog.

 

How to query even inactive users for non-admins ? Please help

 

Script Include:

 

getAssetdetails: function(){
var userID = this.getParameter('sysparm_user_name');
var almHW = new GlideRecord('alm_hardware');
almHW.addQuery('assigned_to',userID);
almHW.addQuery('install_status',1);
almHW.addQuery('substatus',null);
almHW.addQuery('model_category','88uu99886537373883883');
almHW.query();
almHW.getRowCount();

..................etc etc

1 ACCEPTED SOLUTION

Hi @Harsha M V ,

 

Its "user query" business rule. I am attaching screenshot of this business rules as well. I think this  business rule might be conflicting with your script. You may try by deactivating this BR in dev and check if the results are coming as expected even for non admins or not and then if it works you may modify this BR as per your use case however its OOB BR and OOB components are not recommended to be modified. In case if this does not work, check if script include is executing or not in case of non admins as roles could be specified in ACL on the client callable script includes and if non admins does not possess that role, the script include would not execute for them.

Best Regards,
Amish Ranjan

View solution in original post

5 REPLIES 5

Hi @AmishRanjan2 ,

 

Yes the business rule is restricting the inactive user query.

 

Thank you so much for the help.

 

This business rule is in global domain. My issue is domain specific and can i create a new copy of buisness rule for my domain and do changes to the script so that query happens for inactive users as well?