How to insert RITM AND REQ on interaction record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 06:03 AM
How can I insert a RITM record into the "Related Tasks" related list of an Interaction record? There is a "Create Request" button on the Interaction record, and upon clicking that button, a list of items to request is displayed. Currently, the request number populates in the "Related Tasks" related list, but I want to display the corresponding RITM of that request AND request number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 06:17 AM
Hi @mounikakodu
1. The 'Related Task' in the Interaction related list is populated from a Relationship called 'Related Task'. The records which are populated in the Related list are determined from the interaction_related_record Table
2. As per OOB configurations, there is only a link between REQ and Interaction records i.e through the parent_interaction field.But there is no direct link between RITM and Interaction. So, to fulfill my requirement, a new field called u_parent_interaction was created in the RITM table which is referencing the Interaction table.
Then, created a Before query insert BR on RITM table, which sets the u_parent_interaction same as request.parent_interaction.
3. Another 'after' business rule has been configured which executes when parent interaction field value changes, to created new record on Interaction Related Records table.
var ir = new GlideRecord('interaction_related_record');
ir.initialize();
ir.document_id = current.sys_id;
ir.document_table = current.getTableName();
ir.interaction = current.u_parent_interaction;
ir.insert();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 06:39 AM
the related list shows REQ
You can create a defined relationship between RITM and Interaction table and add that in related list on your form in the correct view
1) create new record here "sys_relationship" and remember in REQ field parent_interaction holds the Interaction sysId
(function refineQuery(current, parent) {
current.addQuery('request.parent_interaction' , parent.sys_id);
})(current, parent);
2) then add the related list on Form -> Configure -> Related lists
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 07:52 PM
Hope you are doing good.
Did my reply answer your question?
Members have invested their time and efforts in helping you.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader