Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to configure date field which should not take past date ?

1_DipikaD
Kilo Sage

Hi All,

 

I have a date field on a form . When user select past date other than current date or upcoming date , the date field shouldn't take the value and will show a error message that "The due date should be current or future date". Can we do it both on both UI side and server side ?

 

Thank You

 

1_DipikaD_0-1755840720858.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@1_DipikaD 

yes both is possible i.e. client and server

1) UI policy - no code

No Code date validations through (Catalog) UI Policies 

OR

2) before insert/update business rule with no script

Something like this

AnkurBawiskar_0-1755842110723.png

 

AnkurBawiskar_1-1755842142823.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @1_DipikaD 

 

better use the UI policy which is OOTB and abort the action.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Shashank_Jain
Kilo Sage

@1_DipikaD ,

 

Yes you can do it in both.

 

UI-side Validation (Client-side)
Where: Using Client Script or UI Policy

Why:

Immediate feedback to the user without waiting for a server response.

Improves user experience and reduces unnecessary server load.

 

Server-side Validation
Where: In a Business Rule (before Insert/Update)

Prevents users from bypassing the validation, especially in cases like:

Import Sets

REST API calls

Background scripts

Ensures data integrity in the database.

 

 

 

 

 

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain