Planned start date must be after current date

Black Coder
Tera Guru

In the change request I have to validate the Planned start date that it should be after the current date. I was able to create the Field level error message whenever the planned start date is earlier than the current date. But regardless of that field-level error, when a user submits the form, the wrong value is getting updated.

How can we prevent the user from submitting a form if the planned start date is selected with earliar date

 

14 REPLIES 14

@Black Coder 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Black Coder 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Murthy Ch
Giga Sage

Hi @Black Coder 

 

PFA

 

I have used the on load client script and its working fine..

find_real_file.png

Thanks,

Murthy

Thanks,
Murthy

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Any feedback on what I shared about the no code approach?

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Shailesh Bachha
Tera Expert

Hi,

Please try below business rule

 

(function executeRule(current, previous /*null when async*/) {
if (gs.dateDiff(current.u_end_date.getDisplayValue(), current.u_start_date.getDisplayValue(), true) <= 0)
return;
gs.addErrorMessage('Select Correct Start Date');
current.setAbortAction(true);
})(current, previous);

 

 

Please mark Correct and Helpful if this works for you.

Regards,

Shailesh Bachhav