- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 06:44 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 09:53 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 08:34 AM - edited 07-10-2023 08:36 AM
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()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 09:53 AM
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();