This pattern implements a generic mechanism for dynamically restricting and allowing usage of a record by the business process administrator.
A Dynamics NAV record can be used in a number of functionalities across the application. There are situations, however, when the administrator wants to restrict the consumption of such a record, as well as lift the restriction when it is no longer relevant.
For example, a new customer record should not be used for posting documents until it is approved by the relevant approver.
We could solve this by using the Blocked Entity pattern, but it requires database schema changes, which have an upgrade impact.
The blocked entity pattern involves:
- Adding a “blocked” status field on the record (either a Boolean or in the more advanced cases, an option field refining the usage).
- Adding specific code for the record in every place where the restriction needs to be enforced.
In contrast, the Data-driven Blocked Entity pattern involves adding a new record (data change) to mark the restriction, instead of adding a new field (metadata change).
Written by Bogdan Andrei Sturzoiu