Question Status

Suggested Answer
Donn Lawrence Salvador asked a question on 24 Feb 2013 9:53 PM

I have a project that needs dynamic population of dialog field. lets say, i have a field that accepts number and a button. Upon Clicking of button, the dialog must generate fields based on what you have inputted on the field. example, i have inputted number 5 on the dialog field, when i clicked the dialogbutton, 5 more dialog field must be added to my dialog box, and these fields must be stored on either a list, a container, or any container.

Reply
Martin Dráb responded on 25 Feb 2013 3:44 AM

What exactly is your question?

You can add controls to dialog by calling Dialog.addField(). Also look at this article about runtime form controls.

Reply
Suggested Answer
José Antonio Estevan responded on 25 Feb 2013 6:32 AM

You can handle events on runtime as explained, for example, in this community blog post:

community.dynamics.com/.../handling-events-of-the-runbase-dialog-controls.aspx

But if I understand your question, the behaviour that you're expecting is quite dificult to handle with a dialog and I'll recommend you to develop an standard form. It will be more maintainable and you will have more control with a form object than doing all this logic with a dialog.

But if you absolutely need a dialog, you can play with the methods described in the above blog post .

Reply
Suggested Answer
AlexanderK responded on 14 Apr 2015 3:54 PM

To do this during runtime you run a command like this:

formControl = dialog.formRun().design().addControl(FormControlType::String, 'MakeupANameHere');

Reply
Suggested Answer
Nitesh Ranjan responded on 14 Apr 2015 9:22 PM

I suggest you should look into following form in standard Dynamics AX for reference

\Forms\tutorial_Form_AddControl

Please verify and update us if this helps you

Reply
Suggested Answer
José Antonio Estevan responded on 25 Feb 2013 6:32 AM

You can handle events on runtime as explained, for example, in this community blog post:

community.dynamics.com/.../handling-events-of-the-runbase-dialog-controls.aspx

But if I understand your question, the behaviour that you're expecting is quite dificult to handle with a dialog and I'll recommend you to develop an standard form. It will be more maintainable and you will have more control with a form object than doing all this logic with a dialog.

But if you absolutely need a dialog, you can play with the methods described in the above blog post .

Reply
Suggested Answer
AlexanderK responded on 14 Apr 2015 3:54 PM

To do this during runtime you run a command like this:

formControl = dialog.formRun().design().addControl(FormControlType::String, 'MakeupANameHere');

Reply
Suggested Answer
Nitesh Ranjan responded on 14 Apr 2015 9:22 PM

I suggest you should look into following form in standard Dynamics AX for reference

\Forms\tutorial_Form_AddControl

Please verify and update us if this helps you

Reply