I need to have the maximum time of 48 hours between Planned Start Date and Planned End Date On a Change Request. Would I need to script this or is there an easier method?

tcotton
Giga Expert

My manager has requested that a mandatory time of 48 hours be set between planned start and planned end date. If someone tries to go other it would alert that the requested end date has exceeded 48 hours.   How can I implement this change?

Change 48 hours.JPG

8 REPLIES 8

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Need to script it.. Either onchange when they fill in the end time or onsubmit when they try to save it.


nitin_kumar
Mega Guru

Hi Terrell,



You need to write a script to achieve this. Refer the following links


Client Script Date/Time Functions


Date/Time Functions ServiceNow



Thanks,


Nitin.



Hit Like, Helpful or Correct based in the impact of the response


tcotton
Giga Expert

Maximum, not mandatory. It can be less than 48 hours, just not more


You have to create a client script and script include. Please look into the first link that I have posted and use the client script 'getDateTimeDiff' and script include function 'getDateTimeDiff' and they will return you the time difference between the two dates and write a if condition to clear the Planned End Date if the difference is less than 48 hrs.



Thanks,


Nitin.



Hit Like, Helpful or Correct based in the impact of the response