authorizationbox:3authorizationframework:5work_with_templates

  

Work with Templates

Authorization Templates are used to flexibly setup user related tables in Dynamics Business Central, including extensions / customization and to define how you want the records to be filled. For example: if you authorize users as sales employee the users gets all the permissions sets from that role. Besides the permissions it is possible with templates to automatically make a record in the sales person table in Business Central for the new sales employee. Thus, templates make it possible to create records in certain tables after assigning an organization role to a user. It is also possible to delete a record when removing a user's organizational role.

There are two types of templates. A Master Template is linked to an Authorization Template. The Master Template can be used to assign the generic fields (for all users), including the key fields of the table. The specific fields for some users can be assigned by using Authorization Templates.

For setting up an Master Template you open the window Templates by selecting Authorization Framework > Templates > Master Templates.

This window shows all the Master Templates that are put in place. To make a new one click New.

Table: select the table that you want to use for Master Template
Description: give an description of the template
Skip Table Triggers: Check the box if you want to skip the table triggers

After you filled out the form click on Save & Close to setup the Template lines. Click New to add an template line.

Field No.: select the field you want to filled automatically by using the template
-Value Source: select the value source you want to use.
-Value: you can give up a fixed value
-User: you can use the user information from the user card
-Organizational Role: you can use the information from the organizational role card
-No. Series: the no. series from that table is used
Skip Field Validate: Check the box if you want to skip the Field Validate

After you filled out the form you can choose to Save & Close the line or click for Save & New to make a new line.

This is how you setup Master Templates.

Setting up Authorization Templates goes in the same way as setting up Master Templates. Only you need to open another window. Select Authorization Framework > Templates > Templates. And now repeat the same steps as you did for the Master Template.
After you setup Authorization Template you need to link the template to the organizational role. To do this go to Authorization Framework > Organization Roles. Open the Organisation Role and click New on the Templates tab.

Authorization Template: choose the template you want link with the organization role
Action on Grant: the action that the template needs to do when granting the organization role to a user
Action on Revoke: the action that the template needs to do when revoking the organization role from users

Click Save & Close or click Save & New if you want link another template.

Important! You only can link an Authorization Template to an organization role. You cannot link the Master Template to an organisation role. The Master Template only works if an Authorization Template is set up for the same table and it is linked to the organization role. For example: if an organization role has an Authorisation Template for table 91 than the Master template for table 91 is effective. But if the organization roles has an Authorization Template for another table than there is a Master Template for, the Master Template is not effective.

This is how you setup Authorization Templates.

Pre and Post actions

Pre and Post actions makes it possible to process a specific action before or after the allocation of the organizational role to a user.
To setup an Pre or Post action go to Authorization Framework > Templates > Pre and Post Actions. In this window.

Processing Type: choose when the action needs to take place
Type: type of action an batch or template action

-(Template) Authorization Template: choose the Authorization Template
-(Template) Action on Grant: the action that the template needs to do by granting the organization role to a user
-(Template) Action on Revoke: the action that the template needs to do by revoking the organization role from user
-(Batch) object type: the type of action you want to run (report, codeunit and XMLport)
-(Batch) object id: choose the object you want to run
-Note: this requires customization
Execute per: choose for which company the post or pre action applies

After you fill out the form click on Save & Close, the action is now effective. You do not need to link Post and Pre Action to an organizational role.

This is how you setup Pre and Post actions.

With Approval Templates it is possible by linking templates to an organizational role to determine which approval settings and limits apply to a user. To setup an Approval Template go to: Authorization Framework > Templates > Approval Templates. This window shows all the approval templates.

To setup a new approval templates click New. Name: fill in the name of the template
Sales Amount Approval Limit: give up the sales amount approval limit or give unlimited sales approval
Purchase Amount Approval Limit: give up the purchase amount approval limit or give unlimited purchase approval
Request Amount Approval Limit: give up the request amount approval limit or give unlimited request approval
Approver ID: give up the approver
Substitute: give up de substitute for the approver

After you fill out the form you click on Save & Close and the template is effective.

With Free Fields you can define your own fields with the different types. These field can be used within the Master and Authorization Templates to fill records with user data. To setup Free Fields go to: Authorization Framework > Templates > Free Fields. In this window you can setup two types of Free Fields. The first ten fields are User Free Fields and are showed on the user card and the last five fields are Free Fields Organization Role and are showed on the organization role. The setup of those two types of Free Fields are the same.
Label: the description of the field
Field Type: type of field you can choose between; Text, Integer, Decimal, Date, Boolean and Option Fields. For the types Text, Integer and Decimal you can give up the Max Input Length. For the Option Fields you can give up options split by a Comma. This is how you setup Approval Templates.

  • authorizationbox/3authorizationframework/5work_with_templates.txt
  • Last modified: 2021/07/27 14:36
  • by bas