08 February 2013

X++ code to open a form or menuitem AXAPTA

how to open a form by using x++ code:

static void OpenDisplayMenuItem()
{
Args args = new Args();
;
args.record(VendTable::find("XYZ"));
new MenuFunction(MenuItemDisplayStr(VendTable),MenuItemType::Display).run(Args);
}

------
static void OpenForm()
{ FormRun formRun;
Args args = new Args();
;
args.name(formstr(VendTable));
args.record(CustTable::find("XYZ"));

formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}

4 comments:

  1. Hello,
    Actually i need some guidance regarding Class And Form In Ax2012, what i have to do is to add 2 buttons in a form, now to create a class which actually enable/disable the button1 and to add this class in button2.
    But as we can't initialize a form in a class in Ax, then how could i make it possible.


    Thanks
    Pranav

    ReplyDelete
    Replies
    1. hi,

      can u tell me the total lines of code used in axapta

      Delete
  2. thanks but i want to run a form and mark a record and click a button

    ReplyDelete

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...