- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-17-2025 05:55 AM
Hi Everyone ,
I have written an email notification with email script which show the current year in signature like @2025 for this year how to check for next year . I have attached my email script and notification below . can anyone check my code is it correct or not .
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-17-2025 06:04 AM - edited ā07-17-2025 06:06 AM
Hi @AkashKushwah,
just add +1 as seen below:
var currentYear = new Date().getFullYear();
var nextYear = currentYear + 1;
gs.info(nextYear);
No AI was used in the writing of this post. Pure #GlideFather only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-17-2025 06:31 AM
Hi @AkashKushwah ,
This script may help, it prints the next year dynamically in the email signature:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var gdt = new GlideDateTime();
var curYear = gdt.getLocalDate().getYear(); // safely gets current year as number
var nextYear = curYear + 1;
template.print("@" + nextYear);
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2025 07:26 AM
Hi @AkashKushwah
my response was the same and I replied earlier than the accepted one, can you please tell me why did you decide to accept this solution and not mine? thank you
No AI was used in the writing of this post. Pure #GlideFather only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-17-2025 06:31 AM
Hi @AkashKushwah ,
This script may help, it prints the next year dynamically in the email signature:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var gdt = new GlideDateTime();
var curYear = gdt.getLocalDate().getYear(); // safely gets current year as number
var nextYear = curYear + 1;
template.print("@" + nextYear);
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-20-2025 07:26 AM
Hi @AkashKushwah
my response was the same and I replied earlier than the accepted one, can you please tell me why did you decide to accept this solution and not mine? thank you
No AI was used in the writing of this post. Pure #GlideFather only