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.
What exactly is your question?
You can add controls to dialog by calling Dialog.addField(). Also look at this article about runtime form controls.
You can handle events on runtime as explained, for example, in this community blog post:
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 .
To do this during runtime you run a command like this:
formControl = dialog.formRun().design().addControl(FormControlType::String, 'MakeupANameHere');
I suggest you should look into following form in standard Dynamics AX for reference
Please verify and update us if this helps you