Catalog item End date field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 08:46 AM
In the catalog item there are two fields for date:
State date and End date
The requirement was End date cannot be more than one year from start date.
I want the End date to be maximum one year from start date.
Please help me how we will write client script for this requirement.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 08:48 AM
Hi @ashok17,
You can easily achieve using the Catalog UI policies with proper conditions.
Take a look at this article. It will help you.
No Code date validations through (Catalog) UI Policies
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 09:26 AM
@ashok17 You can write a UI Policy which can validate if the End Date is within the one year form the start date as mentioned below.
end_date is more than 1 years after start_date as shown in the screenshot below.
In the UI Policy action add an entry to clear the value of the end date.
Also in the UI Policy add an alert message so the user will know why the date field is cleared.
Result: Message is displayed when the end date is greater than one year and the end date is cleared.
No Message displayed when the end date is within one year.
Please mark the appropriate response as correct answer and helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 06:57 AM
above solution not works for me in catalog item form
Please help me below requirement:
In the catalog item there are two fields for date:
State date and End date
The requirement was user can't choose End date filed more than one year from start date.
Please help me how we will write client script for this requirement.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 09:23 AM
@ashok17 You dont have to write a client script to validate the dates, it is possible through UI policies. Please follow the above steps and you should be able to achieve the same.
If you still wanted to write a client script, please tell me what you have written and i can help you in changing that to achieve the requirement.
Please mark the appropriate response as correct answer and helpful.
Thanks!!