Set default date for Date field in a Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 01:23 AM
I have a Date variable in a ServiceNow Catalog.
The Date field is at question number 7 and I want to set it's value based on question 1.
I want to set its value to 4 weeks ahead from the current date based on some condition which are selected in the previous question i.e. Q1.
I was thinking of using OnChange Catalog Client Script and GlideAjax() on "
Please help me in finding the solution.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 01:29 AM
Hello Abhi,
// store the above date in variable called date;
var numWeeks =4;
date.setDate(date.getDate() + numWeeks * 7);
Plz Mark my solution as Accept, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 02:15 AM
Hi Samaksh,
Sorry, that didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 02:28 AM
Can you share the Screenshot ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 04:31 AM
Sorry, I cannot share the Screenshot. But for the clarification I can say that I have a Date field in a Catalog item. I want to set it's default value to 28 days from the current date in future.