The sequence of write() method on multiple FormDataSources

Hello all,

I have a question about the execution sequence of write() method on the form with multiple data sources.

For example, the standard InventTable form, it has five data sources: InventTable, Purch, Invent, Sales and InventItemLocation. Each data source can override the write() method. But what’s the executing sequence of these write() methods? I used the info() to test and figured out that the write() of InventTable is invoked last. I think maybe it is the Join source for all other data sources. I don’t know if this principle is applicable to every form in AX. I need your confirm.

Another question is, when user clicks the “Save” button on the toolbar, it begins a transaction for InventTable, Purch, Invent, Sales and InventItemLocation datasource to write data to the table. Is there anyway that I can be notified when this transaction is going to happen and when it is just committed?

Thanks very much!

Sunny Chen

If you create and save a record in InventTable, the sequence of save process will like below:

InventTable save process :

******* First - Validate Write process*********


  1. InventTable ValidateWrite

  1. Purch ValidateWrite

  2. InventTableModule ValidateWrite


  1. Invent ValidateWrite

  2. InventTableModule ValidateWrite


  1. Sales ValidateWrite

  2. InventTableModule ValidateWrite


  1. InventItemLocation ValidateWrite

********* Second - Write process ************


  1. InventTableModule Write, Type = Purchase order

  2. InventTableModule Write, Type = Inventory

  3. InventTableModule Write, Type = Sales order


  1. InventTable Write

Hope it can help for you [:)]

Yes, I know the sequence of the InventTable, however, how about other Forms in AOT? Is there any principle that can be followed?

The parent goes first, then the children, then the children’s children, etc… I’m not sure about siblings, it might be based on the form design, or their order in the datasource node.