Change request Cannot Request Approval if Planned Start has passed
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 05:20 AM
When submitted a Change Request, the user cannot click Request Approval if the Planned Start date is prior to the current date.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2024 04:21 AM
Hi All,
Thank you for helping me.
I got solution, I have written "Onsubmit" client script, it is working as expected.
function onSubmit() {
//Type appropriate comment here, and begin script below
var plannedStartDate = g_form.getValue('start_date');
var currentDate = new Date();
// Convert plannedStartDate to a Date object
var plannedStart = new Date(plannedStartDate);
// Set the time of currentDate to midnight to ignore time part in comparison
currentDate.setHours(0, 0, 0, 0);
// Compare the dates
if (plannedStart < currentDate) { //STRY0010159 - Author - Praveen Rapuru
g_form.addErrorMessage("The Planned Start date cannot be in the past. Please select a future date or today\'s date.");
return false; // Prevent submission
}
return true; // Allow submission if date is valid
}