Hi all,
Recently I reviewed the code from our partner and noticed that they put the text constant into the C\AL Locals section instead of making it global.
In time when I was young and silly developer, we were prohibited to make the text constants local
However, I did not found any mentioning of such restriction in the documentation. Furthermore, the documentation says it is OK to create local text constants
"You define text constants in the C/AL Globals or C/AL Locals window."https://msdn.microsoft.com/en-us/library/dd354917.aspx
Can anybody show me the piece of documentation where the best practice of NOT creating local text constants is described?
I am starting to think maybe our partner made OK. Also, I cannot imagine any reasons for the restriction :-k
Thank you!
Comments
Personally, I prefer to limit the scope of all variables... as well as the benefits of encapsulation, it also makes the C/AL Symbol Menu easier to navigate.
http://blogs.msdn.com/b/nav/archive/2015/01/09/c-al-coding-guidelines-used-at-microsoft-development-center-copenhagen.aspx
if they are local then we don't have to think and there will be no compilation errros
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Microsoft - Dynamics NAV
Our partners are from India, so I think they have the same reasons as Mohana said: simplier merging and fixes.
For me placing text constant into local variables is unusual, but seems it make sense after all.
I also checked the translation tool that we use, it seems it is OK with local text constants, so let partners do as they used to.
Best Regards,
Mariya