Search code examples
formsaxaptadynamics-ax-2012dynamics-ax-2012-r2dynamics-ax-2012-r3

The best place to add some logic after form init and executeQuery


I got an answer on one of my questions here on SO regarding where to place some code after the form initialization.

Event Method Sequences when a Form is Opened

As far as I see, init and run are executing on thread 1 while executeQuery goes on thread 2. So, in order to iterate over the form_ds, I should pick a method which executes on thread 2, just to be sure that executeQuery has finished.

Is that correct? Where exactly is the best place to add some code like datasource iteration?


Solution

  • There is not a single answer to the question as it depends on the situation.

    If you require that executeQuery is executed, consider to place the logic there after super() controlled by a global boolean.