Different behaviour in the Format functions since NAV2013

I never knew you could sort of use the Format C/AL function as a PADSTR function. Did you?

Apparently, you can do FORMAT(SomeString,SomeLength).

I usually put the length to 0 if I need to apply a format expression. But if you actually fill in a value it does something. And it does it differently since NAV2013.

Lets say we have a G/L Account No. which is 600000.
If I call FORMAT(GLAccount.”No.”,20), the return of the format function will actually be a string that is of length 20. It will fill the string with spaces.

Before NAV2013 these spaces would be located after my No. Resulting in “600000              “.
However, since NAV2013, the same function returns ”              600000″.

If you ever used this in your code, and still use the same code since before NAV2013, it might be a good idea to check your functionality!

People who use a BE NAV version and use the report 11313 Link to Accon, the default report also has this problem. (which I also reported to Microsoft)
We had a customer using this report to import the data in another tool (not Accon, but just the file was the same). They have recently upgraded their environment and this issue floated up.

I have no idea if someone uses Link to Accon and/or Accon has issues with the changed export. But it doesn’t hurt to know and share the knowledge with our fellow NAV people! 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.