- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2023 10:51 PM
Hi Community,
I make a date field variable on a catalog page and I need that date selected should be within 2 days from the current date.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2023 11:34 PM
Hi @Deepak Shaerma ,
You can use the UI policy to achieve this.
1. Create a catalog UI policy and use below conditions on your date variable.
Conditions: User not to select the date 2 after days from now and not past date.
2. Script: Give your variable name and msg as per requirement.
function onCondition() {
g_form.clearValue("start_date");
g_form.showFieldMsg('start_date', "Please select date as 2 days from now", "error");
}
Result: Display msg user selects incorrect date.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 02:12 AM
Hi @Deepak Shaerma ,
refer below
If you didn't get create separate question.
Try to search in community definitely you will find many solutions related to it.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar