Set due date 24 hours from created date?

Community Alums
Not applicable

Hi All,

I have a requirement to always set the due date of a specific record producer always to 24 hours after the created date/ always the next day.

How can I achieve this?

Thanks!
Alex

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use record producer script itself and you don't need any extra BR etc?

var gdt = new GlideDateTime();

gdt.addDaysUTC(1);

current.setValue('due_date', gdt.getValue());

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Hi Alex,

Please make sure variable names are correct add some info messages to know where is the problem please.


***Mark Correct or Helpful if it helps.***

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not use record producer script itself and you don't need any extra BR etc?

var gdt = new GlideDateTime();

gdt.addDaysUTC(1);

current.setValue('due_date', gdt.getValue());

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Thank you! All worked 🙂

@Alex

Glad to help.

Would you mind marking your earlier questions as answered by marking appropriate responses as correct to close them.

https://community.servicenow.com/community?id=community_question&sys_id=fb05c69bdbf01510ca6fdb85ca96...

https://community.servicenow.com/community?id=community_question&sys_id=58d70ead1bb860108672ea89bd4b...

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader