
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 09:23 AM
On a Catalog Item, in a new date variable - is there a way to set Default Value to current date and add (for example) 3 days from now?
Above example sets current date. But how can I add 3 more days in the default value?
My goal is to add days dynamic based on Delivery time (delivery_time) in the default value.
Lite this in portal:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 09:40 AM
You can mention under default value
javascript:var gdt=new GlideDateTime();gdt.addDays(3);gdt.getDate();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 09:40 AM
You can mention under default value
javascript:var gdt=new GlideDateTime();gdt.addDays(3);gdt.getDate();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 09:43 AM
It works!
Now to the million dollar question.. Is it possible to use the value from delivery_time instead of the hard coded "3"..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 10:03 AM
We cannot use the default value in that case.
you have to use onChange client script on duration field and there you can do the add the date.
Check this article on how to set the date in the client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 10:55 PM
Thank you Asif for your answer and also to the article you linked to. That will help me alot i think. Just the kind of answer I was hoping to get here.
Have a good day!