What methods are called when a runbaseBatch process is executed?


It can be handy to have detailed knowledge on the runbaseBatch class. In this tutorial I will explain the calling sequence of the RunBaseBatch class with a query (select button).
We will start this process with a static construct function that will force the runbaseBatch process to run on the server. 
In the left column of below table is shown the method name of the runbase batch and the location where it is running. The order of the lines in the table is also the order AX will execute the methods.
(Note: The runbase mechanism calls sometimes methods twice, these duplicate call are removed from this list.)

Server construct
Our constructor will execute the new method
Server new

Server prompt

Server unpack

Server showdialog

Server pack

Client new
Reconstruct the class on the AX client
Client unpack
Get the values from the previous run
Client canGoBatch
Do we need to show the batch tab page
Client prompt

Client showdialog
Do we need to show dialog
Client caption
Set the caption of the dialog
Client queryRun
Get the query object (if exist)
Client showQueryValues
Do we need to query values on the general tab page of the dialog
Client showQuerySelectButton
Do we need to query select button on the dialog
Client showDefaultButton
Do we need default button
Client showClearButton
Do we need clear button
Client dialog
Build your dialog (don’t remove super otherwise you don’t see the batch tab page
Client dialogPostRun
Used to make additional modification to the dialog (field High), set overload methods

Finally our dialog appears on the screen.

Next we press the OK button. The next methods of the runbaseBatch will be executed:

Client getFromDialog
We get the values from the dialog , don’t remove super otherwise batch and select info is gone
Client validate
Check if all dialog values are valid
Client pack
Store the values in the SysLastValue table
Server unpack
Readout the values from the SysLastValue table
Server canGoBatch
Check if we have to run in batch
Server run
Run the process (can be from batch process)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.