how to override query business rules??

shabbir5
Tera Guru

Hi Team,

 

I have a query business rule , on user table , which is having a condition as "current.addQuery('roles=itil');

 

so when i open user table its showing only uses with ITIL role

 

now i have a catalog form 

 

then a variable to reference to USER table

 

so now i am clicking on this variable , its showing the same ITIL users 

 

but i want to override this Business rule for the catalog form

 

how to achieve this ?

 

@Ankur Bawiskar 

 

Thank you,

Shabbir Shaik

4 REPLIES 4

Zach Koch
Giga Sage
Giga Sage

Take a look at this great article. It goes in depth with query business rules including a way to get around them if need be. Here is a screenshot of the relevant section, but I would recommend reading the whole article as it has a lot of good info.

ZachKoch_0-1727355698484.png

 

Query business rule breakdown 

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

shabbir5
Tera Guru

the above doc is not helpful

The api actually looks like they put the wrong boolean argument, it should be current.setWorkflow(false) in your variable query to prevent that query Business rule from running

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

Brad Bowman
Kilo Patron
Kilo Patron

This is an excellent case of why you need to be careful when using query Business Rules.  You will only ever see users with the itil role system-wide, so it's not a great solution in this case.  I would recommend removing that, then revisiting where exactly who should only see itil users.  This can likely better be accomplished with an application module using a default filter, or maybe a query business rule on a database view with the user table joined to itself, so this view will always be itil users only.