- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 01:10 AM - edited 10-30-2022 08:17 PM
Requirement is to Display all the Emails From Incident and Case table to display in the Related list of Case Record.
So i have created a Relationship in case table.
But i am Not able to get the Correct Output, do i need to add any additional query
help me with script .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 03:00 AM
If you are looking for all emails on the incident and case table, then use below statement.
current.addQuery('target_table', parent.sys_class_name).addOrCondition('target_table', 'incident');
If you are looking for emails only on current record, then use below statement.
current.addQuery('instance', parent.sys_id);
If you are looking for emails on current record along with the emails on incident table, then use below statement.
current.addQuery('instance', parent.sys_id).addOrCondition('target_table', 'incident');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 02:39 AM
Hi @devservicenow k ,
Try below query.
current.addQuery("target_table", parent.sys_class_name);
current.addQuery("instance", parent.sys_id);
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 03:00 AM
If you are looking for all emails on the incident and case table, then use below statement.
current.addQuery('target_table', parent.sys_class_name).addOrCondition('target_table', 'incident');
If you are looking for emails only on current record, then use below statement.
current.addQuery('instance', parent.sys_id);
If you are looking for emails on current record along with the emails on incident table, then use below statement.
current.addQuery('instance', parent.sys_id).addOrCondition('target_table', 'incident');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 04:43 AM
Hi,
Which field on Case refer to incident?
Do you want all emails related with incidents (All) or any particular incident which is related with Case?
Thanks
Anil Lande