Testing the State
The typical scenario to use the Entity State Pattern is in preventing transactions from happening in the systems. In order to do this, typically, the TESTFIELD function is implemented. This command allows developers to test a value in a field. The system will generate an error with a predefined syntax. This should be programmed into the transactions where it is applicable.
Note
The Error Message Processing Cookbook recipe helps in testing multiple fields and states in one transaction. You can read more about this in the Microsoft Design Patterns Wiki at https://community.dynamics.com/nav/w/designpatterns/236.error-message-processing.
Alternatively, the Entity State field can also be a part of the Table Relation to the table that the field is a member of. This prevents the record from being used. If this is implemented, then the TESTFIELD function should always be implemented as a safety precaution. An example is testing the Blocked field when selecting an Item in...