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)

Defining Macro

(0) ShareShare
ReportReport
Posted on by 1,310

Hi All,

                In a program I compiled it showed error as the following macro does not exist #CarsXmlTags. How should I define the following macro in

Ax 2009. pls help.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Klaas Deforche Profile Picture
    2,433 on at

    Hi,

    Check the following link on documentation on how to use macro's: http://msdn.microsoft.com/en-us/library/cc197107(v=ax.50).aspx

    In summary, you can define macro's like so:

    #define.MyMacro1(info("Hello");)

    or you can use:

        #localmacro.LMacReportLog
            print("%1  --LM, print.");
            info("%1  --LM, Infolog.");
        #endmacro 

    Or you can also define a Macro in the AOT in the Macros node.

    However, as you can see, when you define a macro, you usually provide it with some kind of "value". This can be any text that can then be inserted in code. So in your case you also need to know wat value the #CarsXmlTags macro has.

    The most likely causes of you compilation error:

    • You didn't do a full compile (if you didn't, please do so)
    • There is something in a higher layer (eg usr) that is overshadowing the place where the macro is defined
    • You are missing an object completely (eg a macro in the AOT)
    • Code has disappeared

    I suggest you do a compare of your code and check where that macro is defined, then use the compare tool to merge the layers if it is overshadowed. If you have an XPO, do a search using a text editor to find if the macro is defined anywhere, if it is not, then you are missing an object.

    But please do a full compile first. It could just be that the macro is defined in a class that is extended by an other, and doing a full compile will make sure that the macro is know to all child classes as well.  

  • Naveen Raaj Profile Picture
    1,310 on at

    Thank you Mr.Klass for the brief explanation it was very useful.

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

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans