- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 10:50 PM
hi folks,
i have a catalog item varaible with the field type date named "date''
i tried using ui policy but didn't fetch me the results. can you please help me out
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 12:04 AM
Hi Vellanki,
You can create a catalog client script onchange to do this. Here is the code and screenshot for reference.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var gdt = new Date(newValue);
var currentDate = new Date();
currentDate.setDate(currentDate.getDate() + 180);
if(gdt>currentDate) {
alert("you cannot select date after 6 months");
}
}
Kindly mark the answer as correct if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 04:05 AM
How can I implement this condition to be valid once the user selects a variable field choice please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 12:20 AM
Hi
Link Limit date selection in date field has a UI policy part for limiting date selection possibly that would help & would be simplest one to set up.
Please mark reply as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 12:43 AM
hi RamS,
i did it using ui policy but i didn't work properly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 12:49 AM
Hi Vellanki,
Did you try the code that I have shared above? Using catalog client script, you can achieve this.