- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2019 07:42 AM
Hi All,
I need help with making a Catalog Client Script to set a default date for a date field that will be four days out.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2019 04:30 PM
Hi,
If it's a Date field, you don't even need a client script. You can click the variable on the record producer and set the default value to be:
javascript: var gdt = new GlideDate(); gdt.addDays(4); gdt.getDisplayValue();
That will automatically set it to 4 days from today.
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2019 04:30 PM
Hi,
If it's a Date field, you don't even need a client script. You can click the variable on the record producer and set the default value to be:
javascript: var gdt = new GlideDate(); gdt.addDays(4); gdt.getDisplayValue();
That will automatically set it to 4 days from today.
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2019 04:29 AM
Thank you so much! Is there anyway to make it business days though?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2019 05:15 AM
Good Morning,
I'll need to look and test something before I can give certain script. For future reference...you should ask for that initially in your question because you did not state that at all. For now, please mark my other reply as Helpful if it was.
Thanks
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2019 05:19 AM
Please reference this link with has correct answer script. Currently, I believe in it, it only adds 1 day, see the addDays line, but you can test it out. This would go in your default value section instead of what I gave:
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!