Microsoft Dynamics NAV allows you to specify record-level security using the Security Filters
field on Permissions
. Here we will discuss how to set up these filters and some pitfalls to watch out for when using them.
From the
RoleTailored client
, navigate to Department | Administration | IT Administration | General | Permission Set.View permission for the role HR-EMPLOYEE.
Using the assist button, set the
Security Filter
field ofObject ID 5200
to a filter based onCity
equal to 'Cambridge'.Close the Security window.
Create a new codeunit from Object Designer.
Add the following global variables:
Name
Type
Subtype
Employee
Record
Employee
Write the following code in the
OnRun
trigger of the codeunit:Employee.SETPERMISSIONFILTER; PAGE.RUNMODAL(0, Employee);
Save and close the codeunit.
The resulting form will contain the details of a single
Employee
variable: