Catalog Item with date based on Business Days

Joseph Navarro1
Tera Contributor

Hello! Currently we have a catalog item that has a field "decommission date" that needs to be auto-populated based on 5 business days from the day of submission. What would be the best way of accomplishing this?

Thank you!

3 REPLIES 3

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi @Joseph Navarro1 
Do you have a schedule with you?

 

 


Thanks and Regards,

Saurabh Gupta

Yes I have access to a schedule

Let me give you a script.

var startDate = new GlideDateTime(new GlideDateTime().getDisplayValue());
		var dur1 = new GlideDuration(60 * 60 * 24 * 1000 * 5);
		var sch = new GlideSchedule();
		var schedule='8f68e08ddb98534048a6e1aa4b9619eb';//	Sys ID of "24*5" Schedule
		sch.load(schedule); // 24*5 schedule
		var d1 = sch.add(startDate, dur1);
		gs.info( d1);
C

If the provided solution meets your needs, kindly consider marking it as helpful and accepting it as the solution. This helps others who may have similar questions.


Thanks and Regards,

Saurabh Gupta