- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2021 02:53 AM
Hello!
I created a 'Create a Normal Change' from the Requested Item. In the Change Request form, I want to add a Requested Item related list that contains the Requested Item. This is similar to the 'Problems', 'Incidents Fixed By Change; related lists.
Please help.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2021 04:55 AM
Hi ceraulo,
I'll show you how to do this, but I want to make sure you understand the process here. When you create a change from an RITM, the RITM is stored in the parent field of the change_request. This means 2 things 1) you can show the Parent field on the change request form to see the RITM and since it's a reference field you can click through to the RITM, and 2) there's only going to be one RITM per change request created this way, so a related list is not ideal, but this can still be done if the parent reference field is not what you're looking for.
Go to System Definition -> Relationships in the left nav. Create a new record. Name it whatever you want to appear as the Related List name. Applies to table = change_request. Queries from table = task. Your Query with script will simply be this.
(function refineQuery(current, parent) {
current.addQuery('sys_id', parent.parent);
})(current, parent);
Now you can configure your change request form to add your new related list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2021 06:29 AM
Hi,
yes if it is defined one then it would only show the name
if it is OOB based on field which is already present then it would show the table name there
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2021 05:56 AM
A similar line is in the out of box Create Change UI Action, so all looks good there. Since your custom related list is really just one record that is displaying the parent reference field record, you don't want either button on the related list. The parent should be updated on the parent reference field if needed.