Add Date (with no timestamp) to the Short Description of an Inbound Email Action

John Bone
Giga Expert

Hello!

 

I have tried several different approaches and I cannot get it to work. I want to add the date to the Short Description of the record being created by my inbound email action. The script below returns "Weekly HR Termination Report - null".

 

var gdt = new GlideDateTime(current.sys_created_on);
var date = gdt.getDate();

current.short_description = 'Weekly HR Termination Report - ' + date;


current.insert();

 

Thank you for your help!

John Bone

1 ACCEPTED SOLUTION

John Bone
Giga Expert

Thanks for the suggestion! I ended up figuring it out after some trial and error: 


var gdt = new GlideDate();

current.short_description = 'Weekly HR Termination Report - ' + gdt;

current.insert();

View solution in original post

2 REPLIES 2

favian1
Kilo Sage

Hello,

 

Have you tried logging the date to the log to see if it is 'null' there too? Also, did you mean to call current.update() instead on current.insert()?

John Bone
Giga Expert

Thanks for the suggestion! I ended up figuring it out after some trial and error: 


var gdt = new GlideDate();

current.short_description = 'Weekly HR Termination Report - ' + gdt;

current.insert();