- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 06:55 AM
Hi All,
I'm creating a view for assets and want to add similar tab CI have which shows installed software. The closest I got with out of the box option was adding software packages(cmdb_ci_spkg) to related list but that won't show anything as it on its own has a related list of CIs from cmdb_software_instance table. I have added a reference to assets on cmdb_software_instance table and now I can see installed software in my assets. It feels a bit wrong as now I will have to amend all the scripts that insert to cmdb_software_instance table to acknowledge assets.
Am I overcomplicating it and there is an easier maybe out of the box way to display installed software on assets? I am wondering if I should leave asset view with options as it is and point users to CIs if they want that information?
Cheers
Greg
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 08:07 AM
Greg,
To do this, you want to create a Defined Related Lists - ServiceNow Wiki. I apologize for the wiki link rather than a newer link on the Docs site, but I was unable to find one. Here are some quick directions, though. I tried this and it worked great.
- Navigate to System Definition > Relationships.
- Click New.
- Complete the form as follows:
- Name: Software Installations to Asset (or a descriptive name of your choice)
- Applies to table: Hardware [alm_hardware] (I used this because it really should only apply to hardware assets)
- Queries from table: Software Installation [cmdb_sam_sw_install] (note: this table is only available if you are working with Software Asset Management, otherwise you should select Software Instance [cmdb_software_instance])
- Query with:
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('installed_on',parent.ci);
})(current, parent);
The template is there, so you only need to add line 4 from this javascript.
Save this record. Then you should be able to select the related list on your Hardware Asset form with the name you identify in Step 3 above.
Good luck!
Ben

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 08:07 AM
Greg,
To do this, you want to create a Defined Related Lists - ServiceNow Wiki. I apologize for the wiki link rather than a newer link on the Docs site, but I was unable to find one. Here are some quick directions, though. I tried this and it worked great.
- Navigate to System Definition > Relationships.
- Click New.
- Complete the form as follows:
- Name: Software Installations to Asset (or a descriptive name of your choice)
- Applies to table: Hardware [alm_hardware] (I used this because it really should only apply to hardware assets)
- Queries from table: Software Installation [cmdb_sam_sw_install] (note: this table is only available if you are working with Software Asset Management, otherwise you should select Software Instance [cmdb_software_instance])
- Query with:
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('installed_on',parent.ci);
})(current, parent);
The template is there, so you only need to add line 4 from this javascript.
Save this record. Then you should be able to select the related list on your Hardware Asset form with the name you identify in Step 3 above.
Good luck!
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2016 08:22 AM
Ha! Thank you very much Ben for detailed answer. Works like a charm.
Cheers
Greg