- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 02:29 AM
Hi Everyone,
I have an use-case where I need to make the duration to be selected after 15 days from the current date. How can I achieve this? Please help!!
Example: If I'm filling this form today, then I want the days from 15 to 29 to be greyed or not possible to select and only days after 15 days user should be able to select.
Regards,
Priya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2022 11:49 PM
Hi,
Please try UI policy if it still not resolved.
1. use relative condition as below and select your date field and give 15 days as shown below.
with this you can select date after 15 days from current date.
Script:
function onCondition() {
alert("Enter valid date, You can select date after 15 days from today");
g_form.clearValue('select_the_duration'); //give your variable name
}
Hope you it helps you.
Please Mark ✅ Correct/helpful if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 02:35 AM
I dont think so its possible, you can put validation using no code (UI Policy) but grey out is something i dont think is implemented.
check this No Code date validations through (Catalog) UI Policies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 03:09 AM
Hi Harshad,
Thank you for your response..
The screenshot attached is from the article
Here, which table has to be selected. I want to select the duration for the catalog which doesn't rely on any table data. And, the tables that are available are only those which I've created.
If I do not select the table, the condition fields are not available.
Regards,
Priya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 03:13 AM
is it a catalog item?
then in catalog item related list you will see a list catalog UI policies, you can click on new, and it should show you all the fields.
Thanks
Harshad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 10:58 PM
Hi Harshad,
Yes, it's in the catalog item..
The below screenshot is the condition that I've given, 'select_the_duration relative after 15 days from now'
This screenshot is of the script
Still, I couldn't find any changes in the catalog when I select the date prior to the mentioned condition..
Can you please help me to understand where I am going wrong..
Regards,
Priya