Setup: Events for filter visibility and action security
With Compliance Field Security it is possible to setup visibility filters on records and to secure actions on pages. By default, this is possible for various default Dynamics 365 Business Central pages and actions (see Action Security List and Pages with Visibility Security). This is done by using event subscribers on those pages / actions. If you want to apply this to non-standard pages and actions included in add-ons or customizations, you have to add your own events for these pages. The events that should be added are shown below.
If you wish to add events for Dynamics 365 Business Central standard pages and actions that are not yet available in our app, please send an event request to support@2-control.nl in which you specify what kind of event and on which page or action you would like to add.
Start by creating a custom codeunit in which you can define all the needed event subscribers. Do not forget to assign permissions to this codeunit for the relevant users. Furthermore, we strongly advice to first implement the new events in a test environment.
Visibility Security
To setup an event subscriber for visibility security, use the code below:
Example of a visibility security on customer list:
Action Security
To setup an event subscriber for action security, use the code below:
Example of action security for Release on Sales Order:
Finally, for action security you have to add a record to table 70078130 that includes a new Action Security record so you can assign permission sets to it. You can use RapidStart to create this record. Example of a record:
Type | Page ID | Action Name | Page Name | Page Caption | Table ID | Table Name | Table Caption | Description |
Action | 39 | Post | General Journal | General Journals | 5406 | Prod. Order Line | Prod. Order Line | Post |