How To Add Additional Dynamic Filters for Data Security

Overview: The Field Level and Data Security product comes with several standard dynamic filters but also the ability to add your own custom filters with just a few lines of code. The following will require a partner developer license and should be performed by a developer with knowledge of the NAV development environment.

1) First review the following How-To document for a basic understanding of the use of Dynamic Filters in Field Level and Data Security.

How To Use Dynamic Filters for Data Security

2) The standard filters are managed in Codeunit 14123806 ES Dynamic Filter Management. In Object Designer, select the codeunit and click Design.

The CalculateFilter function returns the value of the filter at runtime. These calculated values can be viewed by running form 14123832 ES Dynamic Filters from Object Designer.

This codeunit should not be modified directly, since this would cause unnecessary complications with future upgrades.

2) Instead, codeunit 14123814 ES Dynamic Filter Customize is provided expressly for the purpose of allowing for custom Dynamic Filters. In Object Designer, select the codeunit and click Design.

3) A sample using the system TIME function is provided in the code as seen above. Remove the comments from the lines shown. The code should appear as in the screenshot below.

4) Save and compile the code

5) To setup and test the filter, from Object Designer in the Easy Security company, run form 14123832 ES Dynamic Filter and click Functions, Insert Filters from Codeunit. Select codeunit 14123814 ES Dynamic Filter Customize and click Ok.

The MyTime code was inserted automatically.

The custom filter can now be used for filter values in Data Security Codes. In this way, any number of custom dynamic filters can be added to the product.

For information on creating Data Security Codes, see the following How-To document.

How To Create a Data Security Code

Also see :

How To Create User Security Setup

Like   Don't Like

© 2017 All rights reserved.

Related resources

Download software from