Dynamics 365 Business Central: SecurityFilter Option Type and Security Filters

Dynamics 365 Business Central uses Security Filters to manage record-level security. A Security Filter limits the set of records in a table that a user can access.

When Security Filters are applied, the user’s access to data is limited. There may be instances where the desired code behavior may conflict with using Security Filters. The SecurityFilter Option Type allows a developer to specify how Security Filters apply to records in code. The SecurityFiltering Method sets or gets the SecurityFilter Option for a record instance.

SecurityFiltering Method Syntax:

[SecurityFiltering := ] Record.SecurityFiltering([SecurityFiltering: SecurityFilter])

The SecurityFilter Option Type has four options:

Validated:  This is the default value. Filters are respected, and an error is raised if access to a record outside the filtered set is attempted.

Filtered: Filters are respected, and records outside the filtered set do not exist for the user. 

Ignored: Security Filters are ignored for the record instance.

Disallowed: An error is raised if there is a security filter set for the record instance.

To demonstrate the SecurityFiltering on a record, I will use the Permission Set with the Security Filter discussed in a previous post.

With a Security Filter set for the user’s Permission Set, the SecurityFiltering Method use can be demonstrated

 

with the results

 

The example demonstrates the filtered record count with the Security Filter Filtered and with the Security Filter Ignored.

Read more on the SecurityFilter Option Type and SecurityFiltering Method.

Note: The code and information discussed in this article is for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 1

2 comments

    • Ben Opit on August 31, 2022 at 5:18 pm
    • Reply

    Does this work with dimensions too so we can limit based on a dimension or several dimensions?

    1. You can use the security filter on Customers with the Global Dimension 1 and Global Dimension 2 values.
      Global Dimension Filter on Customer

Leave a Reply to Ben Opit Cancel reply

Your email address will not be published.