microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
744 stars 245 forks source link

AA0072 - The name of ItemJournalLine2 is not valid. The name of variables and parameters must be suffixed with the type or object name. #6182

Closed pri-kise closed 4 years ago

pri-kise commented 4 years ago

Describe the bug The CodeCop AL0072 gives wrong info/warning about an record with an Integer as suffix.

To Reproduce Steps and to reproduce the behavior: Declare a variable with the following name

ItemJournalLine2: Record "Item Journal Line";

Expected behavior There shouldn't be a warning or info, since it is very common to add an Integer to a Record Variable if you need different references to the same record table. Screenshots image

5. Versions:

dejfidson commented 4 years ago

Instead of an Integer you can use anything else (maybe more descriptive). The Integer in variables is not good practice. E.g. LocalItemJournalLine or SecondItemJournalLine or NewItemJournalLine or OldItemJournalLine or CopiedItemJournalLine or ...

dzzzb commented 4 years ago

but nonetheless, apparently it should work, as said here: https://github.com/microsoft/AL/issues/6120#issuecomment-686320373

PaulIvan commented 4 years ago

I am closing this issue because it has been resolved, please check the latest developer preview . Please open a new issue if you believe this has not been resolved and reference the current issue.