How to validate start date should not be greater than end date using business rules

gomathysanjana
Mega Expert

How to validate start date should not be greater than end date using business rules

1 ACCEPTED SOLUTION

Here is the example


You need to update the field names


if (gs.dateDiff(current.end_date.getDisplayValue(), current.start_date.getDisplayValue(), true) < 0)


              return;


View solution in original post

9 REPLIES 9

Here is the example


You need to update the field names


if (gs.dateDiff(current.end_date.getDisplayValue(), current.start_date.getDisplayValue(), true) < 0)


              return;


sivaiah
Kilo Contributor

Create a business rule on issues if the contract end date is in past then display an message “Contract of this caller is expired”.

 

Chaitra k1
Kilo Explorer

Can i get a client script code for validating time

if the user chooses start time greater than end time(hh:mm ) then it has to notify end time should be greater than start time

arun38
Tera Contributor

Using Client Script 

can i get a client script for The start date should not be greater than Current date and time?

Hi,

You can try creating new onChange client script on start date field with below code

var todayDate = formatDate(new Date(), g_user_date_time_format);
if(newValue < todayDate){
g_form.addErrorMessage("start date cannot be in past");
g_form.clearValue("start_date");
}

mark my response as correct or helpful if applicable