The Entity State Pattern
In Microsoft Dynamics NAV, the UI elements in the page objects are bound one to one with tables. The tables in the product represent functional elements, such as Customers, Sales Invoices, or Production Orders. The fields that we need in the page have to exist in the table object.
An example of an Entity State field is adding a Boolean field called Blocked, indicating that the record in the table should not be used in a transaction. This field tells us something about the state of the record.
To add information about the records in these tables, we can add fields with predefined options. These field elements are referred to as Entity state. Because we predefine the state in metadata, we can write code against these fields by creating business rules and processes.
Technical description
To implement this Design Pattern, we need to add a field to the table that describes the state. The field is either of the Boolean or Option type. The combination...