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

Notifications

Announcements

No record found.

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,284 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
    237,770 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#2
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

#2
Rahul.p Profile Picture

Rahul.p 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans