- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2022 09:41 PM
Hi Community!
We have a requirement where we need to add a related list to the form of Case record that includes all the other case tickets (both parent and child tickets ) linked to it.
We already have the OOB related list which shows all the tickets for which our given ticket is a parent (comes from the OOB parent field on the form). If there is no child tickets associated to that ticket, it shows “no records to display”.
The ask from them is that there should be a related list with which they can navigate to Parent ticket from child ticket just like they can navigate to child tickets from the parent ticket as shown in figure below.
Is it possible to create one related list like this (without introducing child field on the form). Is there any possibility to show all the associated parent and child tickets in one related list? If this is not possible, how to create related list for parent tickets from child ticket?
Pic 1: Case 001 has the child records as shown (these are all the tickets for which case001 is the parent, similarly, they want a related list which includes the tickets for which case 001 is the child. They want all these to be shown in same related list if possible
Pic 2: child case form
Here instead of just showing the tickets for which 004 is the parent , they want all the linked tickets to be shown here (instead of “child cases” related list, we need related cases” related list, so even the 001 ticket should be shown here as it is the parent.)
Please help me!
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 02:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2022 11:21 PM
Hi, it is technically possible, by creating a custom relationship, but I see a few potential issues with this.
1. How will you know which of the related records is the parent? There will pretty much be no distinction thats obvious at the first glance, so users might have to click around to figure this out.
2. There should theoretically just be one parent. So why is it needed to show it on the list, as opposed to the link from the form?
Again, if you need this, it can be done. Just use a custom relationship and build your query so that either "parent == current.sys_id" or "parent == current.parent.sys_id" - not tested but it oculd be something along those lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 12:34 AM
Hi,
yes you are right that there can only exist one parent, and to identify the parent we have this parent field on the form but they want it in the related list (rather than navigating from info icon beside the parent field) as they felt this related list creation would make them navigate to parent ticket from child ticket easily.
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('parent',current.sys_id);
})(current, parent);
I tried with the above code, and the ones [parent == current.sys_id" or "parent == current.parent.sys_id" ] but these are returning all the case records.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 02:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2022 03:32 AM
Hi,
Thanks for the help!
(function refineQuery(current, parent) {
current.addQuery('parent',parent.sys_id).addOrCondition('sys_id',parent.parent);
})(current, parent);
I used the above code and it seems to be working fine.