
Have you noticed already that in Microsoft Dynamics NAV 2013 the text variables can have unlimited length? That’s quite a leap ahead of the previous versions which couldn’t handle more than 1024 characters per variable. If you wanted to achieve bug-free code then, when you were assigning texts around, you had to concatenate the result down to the MAXSTRLEN of the target text.
Not anymore.
The trick is to simply not declare the Length property on text variables. If you declare a variable of type Text, and then leave the Length empty, it means – unlimited.
Don’t worry – you won’t kill NAV by eating up all the available memory. Underneath C/AL there is .NET now, and strings in .NET are of unlimited length, or better yet – unlimittable – length anyway. Strings will only make things slow if you stuff the revised version of King James’s Bible in them. In all practical situations, there will be absolutely no performance penalty of leaving Texts unlimited.
I don’t know about you, but from tomorrow morning, I won’t be setting Length to my Texts.
Read this post at its original location at
http://navigateintosuccess.com/blog/...th-in-nav-2013, or visit the original blog at
http://NavigateIntoSuccess.com. 47fc2f5642456dfd71e5581a3785c625
Читать дальше