void clicked() { CustTable custTable; FormRun formRun; Args args = new Args(); ; // Just selecting a random record in CustTable select firstonly custTable; // This is the name of the form you are opening args.name(formstr(CustTable)); // This is the optional record you are passing it args.record(custTable); // This builds the formrun formRun = ClassFactory.formRunClass(args); formRun.init(); formRun.run(); // This waits until the form closes if (!formRun.closed()) formrun.wait(true); }
This technical blog will be about my adventures with Microsoft Dynamics 365 for Operations (AX7/D3fo), AX 2012, and AX 2009.
Tuesday, November 15, 2011
How to call a form from code and make it modal
This is how to open a form from X++ and set it modal. Modal means it is on top of the other windows and you can not click on the ones behind it. I have this just in a clicked event on a button.
Subscribe to:
Post Comments (Atom)
Even better you can call the wait method from the form itself!
ReplyDeletepublic void run()
{
super();
element.wait(true);
}
This comment has been removed by the author.
ReplyDeleteThis is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you. www.wirelessinnovationalliance.com
ReplyDelete