Update the filter conditions on related lists
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 10:00 PM
Hi All
The wanted to update the filter on this affected ci related list. I want to use a function from a script include to filter the data here. How can do that ?
This is the filter now.
I want to include principal classes too -> sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()
But I cant add the script,
I can make it static by adding classes with principal classes true but I want it more dynamic if in case any CIs removed or added from principal class later.
Right now I am making the change in List control of the related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 03:57 AM
Consider an approach of creating your own Relationship (under System Definition in the left nav) to display the affected CIs. The Applies to table is the form you want to add the Related List to - use global if there's more than one. Queries from table = cmdb_ci. The Query with script runs on the server, so you can use 'parent.' to get fields from the record displayed, and modify the query results with current.addQuery or .addEncodedQuery. So you'd want to replicate the filter, adding the Script Include call. You would then display this Related List on the form(s) instead of the out of the box one.