Notifications

36 views

Description

When @ mention feature is used on any non-task record on the sysapproval_approver table, for example - a document revision record, the email notification generated doesn't contain document revision number in the subject of the email and also link to the record will be missing in the email.

Release or Environment

Any release

Cause

The underlying issue is that the sysapproval_approver table has two possible ways of referencing documents:

- The "sysapproval" field, which must be a "task"; or
- The "document_id" and "source_table" fields, which can be any type of record (not just tasks).

In the sys_dictionary entry for the sysapproval_approver table, you'll see that the "sysapproval" (task) field is used as the display value for this table, which explains why approvals for non-tasks result in an empty display value.

 

Resolution

In the sys_dictionary entry for the sysapproval_approver table, you'll see that the "sysapproval" (task) field is used as the display value for this table, which explains why approvals for non-tasks result in an empty display value.

One solution to correcting the blank values in the mentions email templates, is to change the email template script on the customer's instance, to display a fallback value in the case of empty reference numbers. For example, right now the email title attempts to say something like, "You have been mentioned in CHG123" (and the "CHG123" is missing in case of non-tasks), but we could give a fallback subject of "You have been mentioned in the kb_knowledge record KB123". You can see the script that sets the subject by selecting "Notification Email Scripts" from the navigator and selecting "ng_activity_mention_body".

On line 3, the script reads:

email.setSubject("You have been mentioned in " + recordGR.getDisplayValue());

This could be changed to something like:

var emailSubject = "You have been mentioned in ";
if (recordGR.getDisplayValue()) {
emailSubject = emailSubject + recordGR.getDisplayValue();
} else {
emailSubject = emailSubject + "the "+recordGR.getTableName()+" record "+recordGR.getUniqueValue();
}
email.setSubject(emailSubject);"

Article Information

Last Updated:2020-01-15 16:18:28
Published:2020-01-16