The CreatorCon Call for Content is officially open! Get started here.

What is 'query' checkbox in Business rule?

jimin han
Kilo Contributor

Hi

What means 'When a table is queried' ?

Does it mean when script like 'GlideRecord.query()' is executed?

 

 

find_real_file.png

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Jimin, Please refer to this blog for more details on query business rules.

 

- Pradeep Sharma

 

Aman Kumar S
Kilo Patron

Hey,

Correct, so basically whenever you are querying a table, this business rule will run and return records the same way.

Eg: You write a query business rule on user table and return query as current.addActiveQuery();

What it will do, wherever you try to populate a user in a reference field, or open user table in list layout, it will only return the list of active users no matter what

Best Regards
Aman Kumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Query business rule is usually used to restrict the records based on some condition/logic similar to table level READ ACLs

More details here with example

Controlling record access using ‘Before Query’ business rules

ServiceNow system security: Before you go crazy with “before query Business rule”

Restricting Access – ACL vs. Before Query Business Rule

Regards
Ankur

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