Forecast Report for scheduled retirement date fall in next to next year

Community Alums
Not applicable

Hello ,

I want to create report on scheduled retirement date for next 2 years.

We have option to select "scheduled retirement" on next year but

how to create report on "scheduled retirement" in next to next year (ie - fall in 2024).

I can select between but this will not be dynamic. Relative is also based on from current date.

 

Thanks,

@Chuck Tomasi @Mark Roethof @Allen Andreas @Ankur Bawiskar @Maik Skoddow @Adam Stout @Thomas Davis 

 

 

3 REPLIES 3

Logan Poynter
Mega Sage

Hello Deepak,

Please see the following article to address your requirements: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0749822 


Please mark my answer as correct/helpful if it has helped you.

Thanks,
Logan

Community Alums
Not applicable

Thanks for the reply.

I am wondering what to write in script for my requirements.

I can use "gs.endOfNextYear()" to get my start time but how to write the end time which will be "gs.endOfNextYear() + 12 Months

 

answer.add('190_Next to Next year@javascript:gs.endOfNextYear()@javascript:gs.endOfNextYear() + ???', gs.getMessage('Next to Next year'));

Hello Deepak,

You would have to do this conversion in a separate variable and then use it in your answer. endOfNextYear() returns a string type so we would have to convert it to a GlideDateTime to manipulate. An example would be: 

var eONY = gs.endOfNextYear();
var eONNY = new GlideDateTime(eONY);
eONNY.addYears(1);
gs.print(eONY);
gs.print(eONNY);

//*** Script: 2024-01-01 07:59:59
//*** Script: 2025-01-01 07:59:59


Please mark my answer as correct/helpful if it has helped you.

Thanks,
Logan
--
LinkedIn