Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 09:11 AM
Hi @Abhilasha G T ,
I tried your problem in my PDI please check below code
Create onChange Client script in Priority field and add below code
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
// Get the planned start and end date fields
var plannedStartDate = g_form.getValue('planned_start_date');
var plannedEndDate = g_form.getValue('planned_end_date');
var startDate = new Date(plannedStartDate);
var endDate = new Date(plannedEndDate);
var currentDate = new Date();
if (newValue == '1') {
if (startDate > currentDate || endDate > currentDate) {
alert("Please select any date in past");
g_form.clearValue('planned_start_date', '');
g_form.clearValue('planned_end_date', '');
}
}
// Condition for Priority 2, 3, or 4
if (newValue == '2' || newValue == '3' || newValue == '4') {
if (startDate < currentDate || endDate < currentDate) {
alert("Please select any date in future");
g_form.clearValue('planned_start_date', '');
g_form.clearValue('planned_end_date', '');
}
}
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak