Hi @JessicaM6884345 

You can try as below.

 

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var date=current.sysapproval.variables.select_end_date_time.getDisplayValue();
var msg="Date is not valid"
if (date) 
{
msg='Date is valid';
} 
template.print(msg);


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

 

 

Hi @JessicaM6884345 
In mail script you already have the current object using which you can dot walk to RITM table, no need to do GlideRecord on RITM table.


View solution in original post

Hi @Saurabh Gupta  

Your code below is working out perfectly. I will replace my version with yours. Awesome, I learned something new today. Thanks to you and the other helpers.

 

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var date=current.sysapproval.variables.select_end_date_time.getDisplayValue();
var msg="Date is not valid"
if (date)
{
msg='Date is valid';
}

 

JessicaM6884345
Tera Guru

Thank you so much for your help. I think I got it working now.

 

Jessica28_0-1702710862988.png

 

View solution in original post

@JessicaM6884345 

Glad to know.

Please close the thread by marking your own response as correct.