Error: You cannot base a date calculation on an undefined date

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Friends,

I got struck up in a place where got an error...
[b]You cannot base a date calculation on an undefined date.

Date: 0D
Formula: +1M[/b]

On activating the Debugger, I found that it shows an error in a code which is given below:

dtOldStart := dtStart;
CASE recServConHead."Invoice Period" OF
  recServConHead."Invoice Period"::Month:
  BEGIN                                                         (ERROR highlighting at this place)
    dtStart := (CALCDATE('<+1M>',dtStart)); 
    dtEnd := (CALCDATE('<+1M>',dtEnd));
  recServConHead."Invoice Period"::"Two Months":
    dtStart := (CALCDATE('<+2M>',dtStart));
    dtEnd := (CALCDATE('<+2M>',dtEnd));

Could anyone tell me what is the issue in it and how to rectify it?

Thanks in advance,
Aarvi R.


  • Options
    DuikmeesterDuikmeester Member Posts: 304
    dtStart := 0D which is not allowed. You have to set it first with for example, dtStart := WORKDATE.
  • Options
    Aravindh_NavisionAravindh_Navision Member Posts: 258
    Thanks a lot for you reply Duikmeester :)
Sign In or Register to comment.