Dialog Extended
One of my colleagues (Koen Dedecker) was looking for a way to prevent user interaction with other forms while a certain dialog is shown. After some research he found the solution on the blog Dynamics AX tools and tutorials from Vanya Kashperuk. A few years ago (2007) he made a simple extension of the dialog class that makes this possible. You can find more information and download some code samples on http://kashperuk.blogspot.com/2007/06/3-dialog-extensions.html.
The trick is actually simple:
- Create a new variable of the type Boolean en the classDeclaration of the Dialog-class
- Create a public parm method for this new variable to get/set the value
- Extend the wait-method by placing the following code before the close-statement:
dialogform.formRun().wait(this.parmShowModal());
Now when you make a new instance of the dialog class just set the value of the parmShowModal() to true. From now on this dialog will stay on top.
Tags: Class, Dialog, Dynamics AX, Programming, Tips & Tricks, X++
This entry was posted on Wednesday, May 12th, 2010 at 06:00 and is filed under Dynamics AX. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

