- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 07:45 AM
Hi,
I have created a Database View on CMDB CI table and custom table. When I am try to report on the DB View, I can able to see all the records.
My requirement is to show only Specific Class records while reporting on the DB View which I have created for that I have created Business Rule on the DB View.
Sample Code:
When to Run: Before and Query
current.addQuery('sys_class_name','cmdb_ci_cluster');
current.addActiveQuery();
But this is not working. Still I can see all classes in report.
Is there is anyway to show only specific Class records in report of the DB View
Thanks in advance
Upender
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2017 12:40 PM
This code worked.
var qc = current.addQuery('conf_sys_class_name','cmdb_ci_lb_ace');
qc.addOrCondition('conf_sys_class_name','cmdb_ci_lb_cisco_gss');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 07:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 07:56 AM
Hi David,
Thanks for your reply, but my requirement is not to expose all Classes to end users.
Regards,
Upender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 08:00 AM
Ah ok, i had this question recently as well and it appears that reference qualifiers do not apply on fields on reports unfortunately.
You can either report directly on the CI class table that you need or create the reports yourself and schedule them to be sent out periodically to users. I suppose you could even build a UI action or something to generate a report on demand for users when they click the button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 08:09 AM
Hi reddy, you need to use the alias (variable prefix) of your database view tables.
For example if your cmdb_ci table has the prefix ci then your query would be:
current.addQuery('ci_sys_class_name','cmdb_ci_cluster');
However I did not test this, never tried before query business rule on database view so I'm not sure if they work.