Notifications

255 views

Description

Even enabling the glide.email.append.timezone system property, the time zone code is not shown in the string that is output in the notification for an email script with a DateTime field.

Steps to Reproduce

1 - Set the system property glide.email.append.timezone value to "true".

2 - Create a new "Test Notification" as follows:

Message:

TEST [current.sysapproval.opened_at] = ${current.sysapproval.opened_at}
Test-TimeZone:
${mail_script:Test-TimeZone}

Set the email script as "Test email script":

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          // Add your code here
         template.print('<table>');
         template.print('<tr><td>Call Reference:</td><td width="25">&nbsp;</td><td>' + 'current.number' + '</td></tr>');
         template.print('<tr><td>current.sysapproval.opened_at <td width="25">&nbsp;</td><td>' + current.sysapproval.opened_at + '</td></tr>');
         template.print('</table>');

})(current, template, email, email_action, event);

 

3 - Execute and trigger the notification. Notice the  time zone code is not shown for "current.sysapproval.opened_at".

Workaround

This is expected behaviour by design. When a date is being printed in a mail_script, in order to get the timezone to display, it is necessary to call the getDisplayValue method on the date/time field. For example:

current.sysapproval.opened_at.getDisplayValue()


Related Problem: PRB1251778

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-10-17 02:41:13
Published:2018-10-17