- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 03:55 AM
Hi!
I have created the following script in Relationship:
I would like to display these in the related list, but no changes are displayed.
Can anyone please help me regarding it.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 07:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 04:23 AM
Hi @DoDo labs___
To display related Change Requests from a comma-separated list stored in the "u_change_list" field of a Problem record:
(function refineQuery(current, parent) {
var lista = current.u_change_list;
if (lista) {
var changeNumbers = lista.split(",");
var relatedChangeRequests = new GlideRecord('change_request');
relatedChangeRequests.addQuery('number', 'IN', changeNumbers);
relatedChangeRequests.query();
// Assuming you want to display related change requests in a related list
var relatedList = current.getOrCreateRelatedList('change_request');
relatedList.addQuery('number', 'IN', changeNumbers);
}
})(current, parent);
Ensure to replace 'change_request' with the actual related list table name in your ServiceNow instance. This script should help display the related change requests correctly in the related list on the Problem form.
--------------------------------------------------------------------------------------------------------------------
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 07:03 AM