Sunday, June 2, 2019

forms and tables methods call sequences in Dynamics Ax 2012

This gives the information of method calls in the form level while
1. Opening the Form.
2. Creating/Updating/Deleting the record in the Form.
3. Closing the Form.
Sequence of Methods calls while opening the Form
Form --- init ()
Form --- Datasource --- init ()
Form --- run ()
Form --- Datasource --- execute Query ()
Form --- Datasource --- active ()

Sequence of Methods calls while closing the Form
Form --- canClose ()
Form --- close ()

Sequence of Methods calls while creating the record in the Form
Form --- Datasource --- create ()
Form --- Datasource --- initValue ()
Table --- initValue ()
Form --- Datasource --- active ()

Sequence of Method calls while saving the record in the Form
Form --- Datasource --- ValidateWrite ()
Table --- ValidateWrite ()
Form --- Datasource --- write ()
Table --- insert ()

Sequence of Method calls while deleting the record in the Form
Form --- Datasource --- validatedelete ()
Table --- validatedelete ()
Table --- delete ()
Form --- Datasource --- active ()

Sequence of Methods calls while modifying the fields in the Form
Table --- validateField ()
Table --- modifiedField ()

Init()   
The first event fired. This is where you will populate default values or add runtime controls.
Think of this as the starting point for everything. It is what happens first.
You can also populate variables that you will use to alter programmability throughout your class.

ds init()   
Each form has a connection to data known as the data source.
Here you can make changes to the way that the form grabs data without actually changing the core data source information.
So maybe, for just this one form,
you want to filter customers by their groups – easily done by going into this method (aka event) and changing things.

Run   
Tells the form to get busy.
You can often dynamically change data sources here, so you could choose to load one data source
based on a set of circumstances

Ds execute Query()
This is where you will often make changes to just to just an individual data source.
For example, in this example we add a queryfilter which acts like a where clause on the Dynamics AX generated query.

canClose()   
Do users want to close the form. If so certain things need to pass such as validate those values as actually true

Close()   
After a form closes, do you want to do anything special?
Maybe you want to open up a new form after the form closes or something else.

I found here a very nice slide: https://www.slideshare.net/HamdaouiAmine/microsoft-dynamics-ax2012-forms-and-tables-methods-call-sequences-30159669

I copied it here because for those like me that can’t access slideshare from work due to the company’s firewall rules:

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

No comments:

Post a Comment