web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Wizard Form to Wizard Class interaction

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm working on a Wizard form (generated using the WizardWizard) which retrieves a record selected in a ListPage (from element.Args().record()) in order to instantiate existing data and display this in form controls on the form.

1) MSDN info is rather thin on the ground so I've been looking at WMSLocationWizard as an example, which seems to instantiate a sysWizard variable as a means to communicate between the form and the class, however I don't understand where the sysWizard is ever instantiated, which seems critical.

Please explain how the sysWizard is instantiated and used to enable access from the form to the class, in my example WMSLocationWizard.

2) I am assuming that the Form and Class are intended to follow the MVC pattern as usual, with the form = view and class = controller; however, I don't understand how the form can communicate with the class. If the wizard class were a xxxTransition class then I'd either instantiate it in my form or call a static method from the form, but I seem unable to do either (the new() method is protected).

Am I broadly correct about the intended usage of the wizard form and class?

3) I can retrieve the record and initialize related tables in the Form init() method, but the call to WIZARD_CLASS::Main(args) method resets the state of my form. I think the database (business) logic should be performed in the class, and I can access my element.Args() in my class in order to instantiate my related tables just fine, but I'm then unable to set the text for my form controls via my form's XXXXWizard.setTexts().

How can I access tables in my Wizard class from my wizard Form setTexts() method?

Any help or general information much appreciated.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi

    You can make table variables in the wizard class and work with them (create public methods get/set and others and use the methods in the form)

  • Community Member Profile Picture
    on at

    Hi Grigory, that has sorted it - thanks very much.

    So I am accessing the (non static) public getter methods declared in the class, from the form via a call to a sysWizard declared in the form class declaration - e.g. (from form) sysWizard.getValue().

    I hadn't realized that the declaration of sysWizard in the form declaration was also instantiating it  :D

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans