Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

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

(0) ShareShare
ReportReport
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,445 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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans