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 the results
The example demonstrates the filtered record count with the Security Filter Filtered and with the Security Filter Ignored.
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