Object version is a system and API supported way for applications to track changes in ERP.net entities.
The changes are aggregated in the Entity aggregates. This means, that, if for example, an external app updates a single Sales Order Line, the update creates a new version for the whole Sales Order aggregate.
Object version reflects this change by increasing its counter with 1.
- Object version is owned by the aggregate root and it's a subject for the whole aggregate tree.
- The version will increment after each change in the aggregate tree- this means attributes, custom properties, references, etc.
Applications should not depend on strict monotonically increasing values of Object version. In some scenarios, it might skip values. However, it is guaranteed, that upon update, the value is changed.
In order for the Object version system to start working, the aggregate (e.g, its root entity) must be setup to Track Changes with at least level 1.
Object version is available through the Domain API for each entity type.
In order for the API to return the object version, it must be explicitly selected in the API call.
Retrieving the object version is resource intensive operation. Perform it only when strictly necessary and only for the entities, for which it is required.