Retro Change date must be in the past

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2019 12:36 PM
Hello,
We have a problem where users are creating Retro Changes with a future date.
What I need is an On Change Client Script which prevents the user from entering a date in the future if the change it Retrospective.
Ideally, the date must be in the past by at least 1 hour, if that is not possible then any past date must be entered the planned_start field and the end field if the change Retrospective.
Can anyone help?
Many Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2019 03:32 AM
Hello Riaz,
You can try below script..
function onChange(control, oldValue, newValue, isLoading) {
if(isLoading || newValue == '') {
return;
}
var date = new Date();
var dateEntered= new Date(getDateFromFormat(g_form.getValue('end_date'),g_user_date_time_format));
if (dateEntered< date) {
alert("Date Cannot be in past");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2019 05:56 AM
Hi Priyanka,
Thank you, however, what I had written was "prevents the user from entering a date in the future" so basically it MUST be a past date.
Any it should only check the Start Date field.
I have seen the above script you have pasted in another thread and it does not work for me.
Thanks,
Riaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2019 01:38 PM
Hello Riaz,
Why Client script? you can achieve that using UI policy
Check this article,
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2019 11:35 AM
Hello Riaz,
Any update on this?
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thank you, Abhishek
Abhishek Gardade