Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

All users are unable to see the newly created field/column in the sys_user table

SN2024
Tera Contributor

Hi,

 

I created a new field on sys_user table called "Deactivated" to record the date and time stamp when the account sets from active to false. I used BR to update the Date and time on the "Deactivated" field.

 

This works and records the date and time but the issue is if I set the account to false, users are unable to see of find the user record that is set to false.

 

Script used for BR:

var gdt  = new GlideDateTime();

current.setValue("u_deactivated_on",gdt);
current.update();

So far I have figuered out this BR is the issue. Can someone please help and suggest what I need to add in this BR so inactive user account who have date and time stamp are visible?
If I deactivate this BR I can see the user accounts
 
Thank you for your help.
11 REPLIES 11

Hi Ankur,

Thank you, this could work if there are only few catalog items, but I need to make the inactive users visible for quite few number of forms or the majority of the forms.

 

would you be able to advise me the best approach to achieve this please?

 

Thank you for your help.

 

Ankur Bawiskar
Tera Patron
Tera Patron

@SN2024 

once you mark active=false on user record then OOTB query BR won't show this user record to non-admins.

Since you are only updating your custom field that should not happen.

Did you check some other BR or Flow is running which marks Active=False when your Custom field changes and is Updated

AnkurBawiskar_0-1761880352896.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader