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)

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

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans