The mandatory date field was successfully saved after entering an invalid date

gongyiping
Tera Contributor

At the dictionary level, “Mandatory = true” is set.

The user entered an invalid date format on the form (e.g., 2025/13/99, a space, or half-width symbols).

After pressing the standard Save button, the record was successfully saved with the field left blank.

The “mandatory check” was not triggered. What is the reason for this?

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@gongyiping 

so you are expecting record should not be saved since user gave invalid date with space or some symbol?

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

Thank you for your reply.

Yes, I think there should be an error displayed under that field, for example, “Invalid Date.”

Hi @gongyiping ,

 

Please check if there is any client script or UI policy there to check the date format and validity checks.

After getting saved does it shows the submitted value in correct format or submitted value on that field?

Check the submitted value in logs/history of that record what got submitted.

 

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!

Hi @Bhimashankar H ,

 

Thank you for your reply.

There is no script checking the date format.

From the logs, the submitted value shows the original input, but it becomes blank when saved to the database.

 

Thanks,

gongyiping