Avoid “not a valid time unit” Errors with Multilanguage Calcdates
October 5, 2008
I had some problems with a German report giving errors when I tried to run it. The people that programmed it put not only the comments in German, but also all calcdates.
As all calcdates where entered in German when I ran the report in an English client, I got an error that ‘-1T’ was not a valid time unit. This is because in English you need to write D for day not T for Tage.
To avoid errors like this and make your reports multilanguage, always write your date formulas in English surrounded by ‘<’ and ‘>’. The report will now use the correct date calculation mo matter what the language of the client is.
Example: CALCDATE(‘+12M-1T’,BeginnGeschäftsjahr) becomes CALCDATE(‘<+12M-1D>’,BeginnGeschäftsjahr).
Entry Filed under: Dynamics NAV. Tags: C/AL, Date, Dynamics NAV, Multilanguage.

Trackback this post | Subscribe to the comments via RSS Feed