Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

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

Posted on by Microsoft Employee

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

  • Martin Dráb Profile Picture
    Martin Dráb 230,056 Most Valuable Professional on at
    RE: (#macrolib.addonmacro) as Syntax error in "classDeclaration"

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: (#macrolib.addonmacro) as Syntax error in "classDeclaration"

    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.

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: (#macrolib.addonmacro) as Syntax error in "classDeclaration"

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans