The Zurich release has arrived! Interested in new features and functionalities? Click here for more

compare two date fields

cray
Kilo Contributor

i have two date fields

1)start date

2)end date

if start date is greater than end date,abort the form from submission

please help me with the businees rule script..

12 REPLIES 12

Please help me 

https://community.servicenow.com/community?id=community_question&sys_id=aa6f9ebb1b23d810d2ccea89bd4bcbef

Harneet Sital
Mega Sage
Mega Sage

Hi Prashanth,



Use the following before business rule with condition (Change the operators if need be between both the dates) :


date.PNG




and in the script part :



(function executeRule(current, previous /*null when async*/){


current.setAbortAction(true);


})(current, previous);


cray
Kilo Contributor

thank you guys....