How to add default filter in reference field window

madhuabbaraju
Kilo Contributor

Hello Everyone,

I'm trying to achieve below functionality

There are two tables 1. Products--- extended from cmdb_ci

2. Application instances -- which extended from Products.

Now when i open application_instances.list   it show records in table. Now when i add filter Products is and click on magnifier symbol it will open a windows which shows records in Products table.

In that popup window i would like to add default filter "Class = Products". (See attached screenshot)

Kindly help me on this

Regards

Madhuri

3 REPLIES 3

Chuck Tomasi
Tera Patron

If you are doing this on a field on a form, you use a feature known as a reference qualifier.



http://wiki.servicenow.com/index.php?title=Reference_Qualifiers


Hi Chuck,



thanks for the quick response. We have already reference qualifier configured for the field Products which calls script include checks for records in "Products class".



In form level it is working. when i try to open in list like in the above screenshot it shows records in application instance table also.


You could do that with a before/query business rule. Use it cautiously because it could end up apply to all product lists (unless that's what you want.)



See section 10 here for an example.



http://wiki.servicenow.com/index.php?title=Scripting_in_Business_Rules#An_Example_Script:_A_Default_...






Reference:


Business Rules - ServiceNow Wiki


Business Rules Best Practices - ServiceNow Wiki