Work with Filter Security
Default Microsoft Dynamics 365 Business Central offers no functionality to secure subsets of data within tables. With the extension Field Security you can define filter s with which you can limit the permissions of users. Note that filtering is supported on any field type except flow fields and only fields in the same table as the records you want to filter on.
The principle of the extension is to permit editing with authorized permission sets. An active filter security has a date in the past or today's date in the field Start Date.
Create Filter Security with the wizard
Follow these steps to create a Filter Security to authorize users to edit specific fields of a table.
1. In the top right corner, choose the Search for Page or Report icon, enter Filter Security Setup Wizard and choose the related link.
2. Choose Filter Security and click Next.
3. Choose a table in which you want to secure the fields by clicking the AssistEdit button. Alternatively, you can enter the object id or the table name in the Table ID field.
4. After selecting the table, you can filter filters on the lines. - Choose a field you want to use for splitting the table in field Filter Field 1. You can also enter the field id. - Enter the value on which you want to filter in the field Filter 1 by text. However, for option fields (e.g. Document Type in table Purchase Header) the options might be retrieved by entering 0|1|2|3|4|5|6|7|8|9 . The software retrieves the textual value, after which you can remove any filter you do not need.
In Filter Security, we made it possible to use calculated filters based on the logged in user. A Calculated Filter allows you to filter by System Variable (User ID, User Security ID and Current Company, by type Date Formula and by the logged in user where the system can use the table 91 (User Setup) and table 156 (Resource). In the User Setup the User ID is available. The filter on the Resource is based on the field Time Sheet Owner User ID. The field Filter Value Type must be set to Calculated. After that, a Calculated filter can be selected in the Calculated Filter Field. Examples of Calculated Filters can be imported from the Calculated Filters setup page with the button Load Demo Data.
5. Permission to edit a part of the table is granted through assignation of a permission set to a line in the filter security. Assign permission set(s) to the field you entered in the previous step.
6. To assign permission set(s) to a filter:
- Choose Assigned Permission Sets on the ribbon under Line to open the window Permission Sets per Filter Security. Alternatively, choose No. of Assigned Permission Sets on the line.
7. Click New. - Choose the first line and select the AssisEdit button. The page Permission Sets opens.
- Select the permission set you want to assign the filter to.Note: Keep in mind that you probably need extra permission sets for every filter if you want a complete split of the table. In such case it is important to choose logical names for ease of management and documentational purposes.
- Confirm the selection by clicking OK.
- Do this for every line you created.
Note: the filter security is only active if assigned to permission sets. It is inactive if assigned permission set(s) assigned to the filter security ANDa permission set with both insert, modify and optionally delete permissions NOT assigned to the filter security.
8. The filter security is inactive until the Starting Date contains a date in the past or today. Furthermore, the filter security is inactive when the field End Date contains a date in the past.
9. If the user for which you have setup a filter security logs out of Dynamics 365 Business Central and logs in again, the field security is activated.
Create a Filter Security manually
1. In the top right corner, choose the Search icon, enter Filter Security and choose the related link.
2. Choose the action New in the Filter Security List.
3. Complete the following fields in the header.
- No.: Automatic and / or manual, based on the number series settings.
- Description: E.g. Field Security Table 27 Item.
- Table ID: Select the ID of the table that you want to secure on field level. You can use the list of tables or enter the object id directly.
4. Filter Security splits a table in parts based upon filters. Set up a filter: - Choose the field you want to filter on in Filter Field 1 by opening the list of fields in the table through the AssistEdit button. Alternatively, you can enter the field id. - Fill the filter value you want to assign in the field Filter 1. In the screenshot, every document type in the table Purchase Header has its own line.
5. Assign permission set(s) to the filter line. - Open the window Permission Sets per Field Security by clicking the number No. of Assigned Permission Sets on the line. - Click New to add a new line. - Choose the first line and select the AssisEdit button. - Confirm the selection by clicking OK. - Do this for every line you created. - Note: the filter security is only active if assgined to permission sets. It is inactive if assignedpermission set(s) assigned to the filter security AND - a permission set with both insert, modify and optionally delete permissions NOT assigned to the filter security.
6. The filter security is inactive until the Starting Date contains a date in the past or today. Furthermore, the filter security is inactive when the field End Date contains a date in the past.