mibuso.com

Microsoft Business Solutions online community
It is currently Sun May 19, 2013 2:22 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Date field not under 1753 in Native
PostPosted: Fri Nov 23, 2007 4:57 pm 
Offline
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Fri Dec 06, 2002 11:50 am
Posts: 3390
Location: Kontich, Belgium
Country: Belgium (be)
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:



Code: Select all
//*** Waldo BEGIN
IF EVALUATE(Date,DateText) THEN BEGIN
  IF Date < 01011753D THEN BEGIN
    DateText := '';
    MESSAGE('Your Error Message');
    ERROR('');
  END;
END;
//*** 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. :|

_________________

Eric Wauters
MVP - Microsoft Dynamics NAV
My blog


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: