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 :
Microsoft Dynamics AX (Archived)

(#macrolib.addonmacro) as Syntax error in "classDeclaration"

(0) ShareShare
ReportReport
Posted on by

public class test extends RunBaseBatch

{

#macrolib.addonmacro 

...

...

...

#DEFINE.CurrentVersion(2)
#LOCALMACRO.CurrentList
FileName
#ENDMACRO

}

- I got (Syntax error) in declaring the macro library.

Please advice.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi H2K,

    Do you have Macros with name "addonmacro " in AOT under Macros node ?

    You should have it because #macrolib means that you want to use macros defined in AOT  within current code.

  • Community Member Profile Picture
    on at

    Yes Mister, I have that macro created in Macros node.

    The other class that used the same macro works fine and the error just came up on this new class.

  • Martin Dráb Profile Picture
    238,844 Most Valuable Professional on at

    On compilation, the text in the macro definition is put at the place at the reference. And the result possible can't compile, e.g. because the macro is expected to be used elsewhere (e.g. inside a method instead of class declaration), it defines a variable with name which is already used in the class and so on. A useful technique is to paste the content of the macro manually, compile the code and review compilation errors.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans