Need to populate a due date field 14 days for current date

Nic Omaha
Tera Guru

Hello, I am combed through the community but I seem to be stuck on what is probably a very simple request. I need to get the due date on our requests to default out 14 days and then we can change it manually if need be. Everything I have seen doesnt seem to work. Any ideas?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Nicholas,



The easiest way would be with a before insert business rule.



var now = new GlideDateTime();


var twoWeeks = now.addDays(14);


current.due_date = twoWeeks;


View solution in original post

7 REPLIES 7

Hi Nicholas,



Are you looking to have the form display a default value or just save it on the back end (database) when you submit the form?



FYI - Be careful where you set the default value in the dictionary (ie. watch the Table field.) This may be inherited from the Task table so setting a default value may impact incident, project, requests, etc. A dictionary override may be more appropriate so you can target a specific table. The business rule has a Table field as well so you can target the due date for your process specifically that way.


This is actually for our Facilities Requests, so when submitted they would like they to display a due date of 14 days and then manually change it if they feel it should be done sooner. I thought about that as well and agree with the dictionary override comment. Thanks for brainstorming with me on this I actually just got it working! Have a great day!


Hi Nicholas,



Thanks for the update. Can you share screenshot of dictionary record.