Showing posts with label Macro. Show all posts
Showing posts with label Macro. Show all posts

Wednesday, July 3, 2019

Macro parameters and strFmt in Dynamics ax 2012

static void JobEF_MacroWithParameters(Args _args)
{
    #define.MyMacro("ciao  %1")
    
    //use localMacro only when in a class declaration. 
    //in a method can also use #define
    #localMacro.Pippo
        //must escape to use it in a strFmt: 
        //see http://www.axaptapedia.com/Macro
        'ciaoooo \%1' 
    #endMacro
    
    str pippo = 'pippo1';
    
    //it does not take the variable pippo, but it use it a simple text
    info(#MyMacro(pippo)); 
    info(strFmt(#Pippo, pippo));
}