web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Naming of DotNet Variables in Business Central V16.5

(0) ShareShare
ReportReport
Posted on by 15

How to name DotNet Variables on prem.

example:

var
        MySQLDataSet: DotNet SQLDataSet;
        SQLDataSet: DotNet SQLDataSet;
        SQLDataSetSystemDataDataSet:  DotNet SQLDataSet;
        MySQLDataSetDotnet: DotNet SQLDataSet;
        MyDotnetSQLDataSet: DotNet SQLDataSet;

i tried all this but still the same Message. AL(AA0072) The name of XXX is not valid. ...

Have anybody any idea?

I have the same question (0)
  • Suggested answer
    raelhefn Profile Picture
    Microsoft Employee on at

    Hi Martin,

    first you must declares the DotNet assemblies that you need to use. after that declares the functions that uses the DotNet variables and performs the actions.

    For more information please refer to this blog post, an example of how to declares / name DotNet Variables.

    demiliani.com/.../

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    Please check the below blog, which uses SqlDataSet

    www.hannesholst.com/.../

  • Martin4310 Profile Picture
    15 on at

    Sorry, but this is not my problem everything works fine with DotNet. But the source control shows me always that i have to change the naem of the variables. See error AL[AA0072) as i mentioned before.

  • Suggested answer
    Guillem Padilla Profile Picture
    427 on at

    Hi Martin,

    Using the actual assembly name is working for me to bypass this rule warning, I think Microsoft team should check it out as the alias assigned to dotnets is not working properly for this rule.

    Example:

    dotnet
    {
        assembly(mscorlib)
        {
            type(System.DateTime; MyDateTime){}
        }
    }
    
    MyDateTime: DotNet MyDateTime; //AL(AA0072) Warning
    "System.DateTime": DotNet MyDateTime; //Not warning

    As it seems wrong to me to declare the variable in this way ("System.DateTime"), I would give it the same name as the alias (MyDateTime) and wait for Microsoft to correct the error, you can add a case in Github informing about this here
  • Martin4310 Profile Picture
    15 on at

    Thank you very much. This solve my problem but it is really strange. I add a case in Github.

  • Suggested answer
    Guillem Padilla Profile Picture
    427 on at

    For anyone who wants to follow the course of this issue, this is the link: github.com/.../6457

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans