Set default value for a date field to be six months from now

sharonjanisch
Tera Contributor

We are creating a custom application to keep track of security exceptions.     We have a date field on the form for the Next Review Date.     How do we set the default value for that field to be six months from the current date?

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Put this in the default value of the field dictionary


javascript:   var gdt = new GlideDateTime();gdt.addMonthsLocalTime(6);gdt.getDate();


View solution in original post

7 REPLIES 7

Natsufab3
Kilo Guru

Hi,


  think this might be helpfull


Set Default Value of a date field to 30 days from today



Thank you


Abhinay Erra
Giga Sage

What is the field type? Date or Date/Time


It's just a date field.  


Abhinay Erra
Giga Sage

Put this in the default value of the field dictionary


javascript:   var gdt = new GlideDateTime();gdt.addMonthsLocalTime(6);gdt.getDate();