Though set-based operations work great when mass updating or deleting records, we get into a bit of a problem when mass inserting records into multiple tables that have a parent/child type relation, for example, transaction headers and transaction lines.
As an ID (key) is needed from the transaction header before transaction lines can be created, developers are forced to make multiple calls to the database within a large transaction block.
In Dynamics AX 2012, this problem was addressed by the
UnitOfWork is a system class and is used to comment a number of records in a single transaction. The class is aware of the relationship between tables and can automatically fill in the related value fields. For example, transaction ...