User need to display button based on two menuitems but form name is same .

If the user need to display button based on two menuitems but form name is same 

Menuitem = CustInvoiceJournal(Free text invoice)
                     CustInvoiceJournal_Action(Sales Invoice)
Form name = CustInvoiceJournal.

In Form -> Init() -> write code.

if(element.args().menuItemName() == menuitemDisplayStr(CustInvoiceJournal_Action))
    {
        FCC_SOInvoiceReport.visible(false);
        info("FCC_SOInvoiceReport False");
    }
    else
    {
        FCC_SOInvoiceReport.visible(true);
        info("FCC_SOInvoiceReport true");
    }

Comments

Popular posts from this blog

AX 2012 R3 Line by line invoicing the sales order using X++ code

Getting Workflow Approvers In Dynamics AX (AX 2012)

To display mainacc and posting profile account in General ledger