{"id":12461,"date":"2016-04-05T10:10:54","date_gmt":"2016-04-05T09:10:54","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/nav\/?p=12461"},"modified":"2024-03-05T12:02:16","modified_gmt":"2024-03-05T20:02:16","slug":"design-pattern-data-driven-blocked-entity","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/","title":{"rendered":"Design Pattern: Data-driven Blocked Entity"},"content":{"rendered":"

This pattern implements a generic mechanism for dynamically restricting and allowing usage of a record by the business process administrator.<\/p>\n

Problem<\/b><\/p>\n

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.<\/p>\n

For example, a new customer record should not be used for posting documents until it is approved by the relevant approver.<\/p>\n

We could solve this by using the Blocked Entity pattern<\/a>, but it requires database schema changes, which have an upgrade impact.<\/p>\n

The blocked entity pattern involves:<\/p>\n

    \n
  1. Adding a “blocked” status field on the record (either a Boolean or in the more advanced cases, an option field refining the usage).<\/li>\n
  2. Adding specific code for the record in every place where the restriction needs to be enforced.<\/li>\n<\/ol>\n

    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).<\/p>\n

    Read more on the NAV Design Patterns wiki site…<\/a><\/p>\n

    Written by Bogdan Andrei Sturzoiu<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"

    This pattern implements a generic mechanism for dynamically restricting and allowing usage of a record by the business process administrator. Problem 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<\/p>\n","protected":false},"author":4552,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"post_tag":[],"product":[],"content-type":[18],"topic":[],"audience-type":[],"audience":[4684],"ms-author":[],"coauthors":[2302],"class_list":["post-12461","post","type-post","status-publish","format-standard","hentry","content-type-thought-leadership","audience-business-leader","review-flag-new-1593580245-522"],"yoast_head":"\nDesign Pattern: Data-driven Blocked Entity - Microsoft Dynamics 365 Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Design Pattern: Data-driven Blocked Entity - Microsoft Dynamics 365 Blog\" \/>\n<meta property=\"og:description\" content=\"This pattern implements a generic mechanism for dynamically restricting and allowing usage of a record by the business process administrator. Problem 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\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Dynamics 365 Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-05T09:10:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-05T20:02:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-content\/uploads\/2022\/04\/Microsoft-logo_rgb_c-gray_950.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"950\" \/>\n\t<meta property=\"og:image:height\" content=\"413\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Dynamics 365 Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 min read\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\"},\"author\":[{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/author\/microsoft-dynamics-365-team\/\",\"@type\":\"Person\",\"@name\":\"Microsoft Dynamics 365 Team\"}],\"headline\":\"Design Pattern: Data-driven Blocked Entity\",\"datePublished\":\"2016-04-05T09:10:54+00:00\",\"dateModified\":\"2024-03-05T20:02:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\"},\"wordCount\":196,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\",\"name\":\"Design Pattern: Data-driven Blocked Entity - Microsoft Dynamics 365 Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#website\"},\"datePublished\":\"2016-04-05T09:10:54+00:00\",\"dateModified\":\"2024-03-05T20:02:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Design Pattern: Data-driven Blocked Entity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/\",\"name\":\"Microsoft Dynamics 365 Blog\",\"description\":\"Modernizing Business Process with Cloud and AI\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#organization\",\"name\":\"Dynamics 365 Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"width\":259,\"height\":194,\"caption\":\"Dynamics 365 Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Design Pattern: Data-driven Blocked Entity - Microsoft Dynamics 365 Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/","og_locale":"en_US","og_type":"article","og_title":"Design Pattern: Data-driven Blocked Entity - Microsoft Dynamics 365 Blog","og_description":"This pattern implements a generic mechanism for dynamically restricting and allowing usage of a record by the business process administrator. Problem 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","og_url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/","og_site_name":"Microsoft Dynamics 365 Blog","article_published_time":"2016-04-05T09:10:54+00:00","article_modified_time":"2024-03-05T20:02:16+00:00","og_image":[{"width":950,"height":413,"url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-content\/uploads\/2022\/04\/Microsoft-logo_rgb_c-gray_950.webp","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Dynamics 365 Team","Est. reading time":"1 min read"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#article","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/"},"author":[{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/author\/microsoft-dynamics-365-team\/","@type":"Person","@name":"Microsoft Dynamics 365 Team"}],"headline":"Design Pattern: Data-driven Blocked Entity","datePublished":"2016-04-05T09:10:54+00:00","dateModified":"2024-03-05T20:02:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/"},"wordCount":196,"commentCount":0,"publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/","url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/","name":"Design Pattern: Data-driven Blocked Entity - Microsoft Dynamics 365 Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#website"},"datePublished":"2016-04-05T09:10:54+00:00","dateModified":"2024-03-05T20:02:16+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/business-leader\/2016\/04\/05\/design-pattern-data-driven-blocked-entity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/"},{"@type":"ListItem","position":2,"name":"Design Pattern: Data-driven Blocked Entity"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/","name":"Microsoft Dynamics 365 Blog","description":"Modernizing Business Process with Cloud and AI","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#organization","name":"Dynamics 365 Blog","url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","width":259,"height":194,"caption":"Dynamics 365 Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/#\/schema\/logo\/image\/"}}]}},"word_count":190,"msxcm_display_generated_audio":false,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Dynamics 365 Blog","distributor_original_site_url":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/posts\/12461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/users\/4552"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/comments?post=12461"}],"version-history":[{"count":1,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/posts\/12461\/revisions"}],"predecessor-version":[{"id":189761,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/posts\/12461\/revisions\/189761"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/media?parent=12461"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/post_tag?post=12461"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/product?post=12461"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/content-type?post=12461"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/topic?post=12461"},{"taxonomy":"audience-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/audience-type?post=12461"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/audience?post=12461"},{"taxonomy":"ms-author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/ms-author?post=12461"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/dynamics-365\/blog\/wp-json\/wp\/v2\/coauthors?post=12461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}