Monday, November 13, 2017

Using Infolog Ax 2012 R3

In this post you can learn how to use InfoLog class for sending a beautiful and professional messages in Dynamics Ax, however final user could not notice your effort.

static void testJCAinfo(Args _args)
{

    SetPrefix("Grandpa");
    SetPrefix("Dad");
    SetPrefix("Me");
    Infolog.add(Exception::Warning,"Puppy");
}

And the result is:



Now you have the power to agroup the info messages in Ax, but you can give more functionally if you want. check the code below


static void Test(Args _args)
{
      SysInfoAction_FormRun    infoAction =       SysInfoAction_FormRun::newFormName(formStr(EcoResProductDetailsExtended)); //Which form?

    
    infoAction.parmCallerBuffer(InventTable::find('TEST5')); // which record??
    
    Infolog.add(Exception::Warning,"El artículo no está propiamente configurado",'',infoAction);

}


First, we got the itemid with errors (TEST5)

In the message infolog we select the message


Notice a new button is appear automatically, and if you click on it, Ax shows you the EcoResProductDetailsExtended with the TEST5 Item.





No comments:

Post a Comment