- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 12:26 AM
Hi Everyone,
I'm hoping this is simple - I thought it would be simple anyway but couldn't figure it out.
I want to add a list of email notifications to incident and task records so there will be an easy way to see what emails were generated from each record. Rather than having it in the activity formatter.
Could anyone tell me the best way to achieve this?
Regards
Harry
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:34 AM
I think you are not configuring the relationship correctly:
- Applies to table: it should be the table where you want to show the related list (e.g: incident).
- Queries from: the correct table is sys_email.
In the Query script, you have to use parent.number instead of current.number.
Another way to query is to use the instance field from the sys_email table:
(function refineQuery(current, parent) {
current.addQuery('instance', parent.getValue('sys_id'));
current.addQuery('type', 'IN', 'received,sent'); // If you want to filter send-ignored email, etc.
})(current, parent);
Hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:19 AM
How you care creating the relationship ? would be helpful if you provide the screenshot of the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:34 AM
I think you are not configuring the relationship correctly:
- Applies to table: it should be the table where you want to show the related list (e.g: incident).
- Queries from: the correct table is sys_email.
In the Query script, you have to use parent.number instead of current.number.
Another way to query is to use the instance field from the sys_email table:
(function refineQuery(current, parent) {
current.addQuery('instance', parent.getValue('sys_id'));
current.addQuery('type', 'IN', 'received,sent'); // If you want to filter send-ignored email, etc.
})(current, parent);
Hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:46 AM
This worked perfectly. Removed the line that filtered the sent emails and it showed exactly what I need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:39 AM
Hi harry,
You are querying on wrong table, please query on "sys_email" table instead of "sys_email_log" table. If you just change the Queries from table to "sys_email", it will resolve your problem.
Thanks,
Param