Source: My Blog.
Thanks to Kine's comment, I was able to create a somewhat workable solution.
It's quite simple. Just add following code at the beginning of the MakeDateText-function in Codeunit 1:
//*** Waldo BEGIN
IF EVALUATE(Date,DateText) THEN BEGIN
IF Date < 01011753D THEN BEGIN
DateText := '';
MESSAGE('Your Error Message');
//*** Waldo END
Off course, you can change the documentation lines .
It was a problem to raise the error in a proper way. I mean, when just raising the error, the message poped up at the proper time, but still, the value was filled in. As I didn't have the previous value of the field, I decided to empty the field, and then raising the error. Other solutions could be:
to switch the year to the current year
to work with a CONFIRM
to create some logic to propose the most probable date
Anyway, hope it's useful.
MVP - Microsoft Dynamics NAV