- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 03:57 AM
Hi All,
On my Problem form I have a simple reference qualifier operating on a field referencing the company table. When i'm running reports on the Problem table, if i want to add a condition based on this field the reference qualifier is ignored and i'm given all records from the companies table rather than the subset defined by the reference qualifier.
Is there a way to make the fields on reports take account of the reference qualifiers that have been set on them on the table?
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 05:35 AM
Yes, this is the servicenow behavior. The reference qualifiers doesn't applies on the report. Actually this is a global behavior and it is not feasible to set the before query for all. If there is one or two case then it can be managed with script. I will not recommend to write script for your case.
Regards
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2023 05:58 PM
Hi Aishwarya
You do not need to retrun anything in the business rule. just create a before query business rule and in the script add an addQuery() or addEncodedQuery() function with your query. See the below example.
Lets say, you want to restrict ITIL user to see security related incident records.
- Create a new business rule on incident table
- Check advanced checkbox true
- Select When as before
- Check query checkbox true
- in the script write below
if (gs.hasRole('itil'))
current.addEncodedQuery("category!=Security");
This is just a simple example. Use business rule condition to add your required condition. Just make sure this script does not impact others.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2023 07:25 AM
Thank you very much Harsh !!!