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 get 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.
The user data and the free fields, combined with the templates, can be used to easily maintain user related data in Business Central.
For setting up a Master Template go to Authorization Framework => Templates => Master Templates and click on 'New'.
Table : Select the table that you want to use for Master Template.
Description : Give a description of the new Template.
Skip Table Triggers : Check the box if you want to skip the table triggers.
Click on 'Save & Close'.
In the next screen click on ‘New’ to add a Template Line.
Field No. : Select the field you want to have filled automatically by using the Template.
Value Source : Select the value source you want to use.
- Value : Give up a fixed value.
- User : Use the user information from the user card.
- Organizational Role : 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 Validation
Click on ‘Save & Close’ to finish or click on ‘Save & New’ to add a new line for that Template.
Go to Authorization Framework => Templates => Templates and click on 'New'.
Table : Select the table that you want to use for this Authorization Template.
Description : Give a description of the new Template.
Skip Table Triggers : Check the box if you want to skip the table triggers.
Overwrite manually set values? : Check the box if you want to modify it for every template that applies to the same table.
Click on 'Save & Close'.
If a Master Template is available for that table, the box of “Has Master Template” is checked.
Click on 'New' to add a Template Line.
Field No. : Select the field you want to have filled automatically by using the template.
Value Source : Select the value source you want to use.
- Value : Give up a fixed value.
- User : Use the user information from the user card.
- Organizational Role : 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 Validation
Click on ‘Save & Close’ to finish or click on ‘Save & New’ to add a new line for that Template.
After you have set up the Authorization Template, you need to link the template to an Organization Role.
Go to Authorization Framework => Organization role and open the Organization Role you want to assign this / an Authorization Template to.
Click on 'New' on the fasttab “Templates”.
In the next screen fill in the required fields.
Authorization Template : Choose the Template you want link with the Organization Role.
Action on Grant : Choose the action that the Template needs to do when granting the Organization Role to a user.
Action on Revoke : Choose the action that the Template needs to do when revoking the Organization Role from users.
Click on 'Save & Close' to finish adding an Authorization Template to this Organization Role or choose ‘Save & New’ to link an other Template.
You can only link an Authorization Template to an Organization Role, not a Master Template.
The Master Template only works if an Authorization Template is set up for the same table and is linked to the Organization Role.
e.g. If an Organization Role has an Authorization Template for table 91, the Master Template for table 91 is also effective.
When an action is triggered on a user (by a template), you can find these actions on the user card under the fasttab “Processed Actions”.
Should a synchronization of this user shows an ‘orange badge component’, this means one or more templates could not be processed correctly.
This also will be visible in the Processed Actions on that user card.
The synchronization process however, is not influenced by this warming.
In addition to the Error message, clicking on the “magnifying glass” of the faulty query, will also show what went wrong in that template.
Pre and Post actions make it possible to process a specific action before or after the allocation of the Organizational Role to a user.
You do not need to link Post and Pre Action to an Organizational Role.
Pre and Post actions are also triggered when Users are manually synced from the User page or the Database page (the “Synchronize all” option).
Go to Authorization Framework => Templates => Pre and Post Actions and click on 'New'.
Processing Type : Choose when the action needs to take place;
Type : Choose the type of action;
Execute per : Choose for which company the post or pre action applies :
'Save & Close' : Saves the action and closes the screen. The action is now effective.
‘Cancel’ : Cancels adding the action.
By linking Approval Templates to an Organization Role, you can determine which limits apply and, if required, who should be the approver(s) for that Template.
Go to Authorization Framework => Templates => Approval Templates and click on 'New'.
Name : Fill in the name of the Template.
Sales Amount Approval Limit : Set the sales amount approval limit or set unlimited sales approval (checkbox).
Purchase Amount Approval Limit : Set the purchase amount approval limit or set unlimited purchase approval (checkbox).
Request Amount Approval Limit : Set the request amount approval limit or set unlimited request approval (checkbox).
Approver ID : Choose the main approver.
Substitute : Choose the substitute for the main approver.
‘Save & Close’ : Save the Approval Template and closes the page.
‘Cancel’ : Cancels adding the Approval Template.
After you have saved the template, you can add it to the Organization role by opening the role and choose the template in the header.
Should a user have more than one organization role with Approval Templates assigned, the template with the highest values will be applied in a request.
When the Approver and the Substitute are empty in the Approval Template, the already existing Approver and Substitute in Business Central will not be cleared/removed by this template.
You can only replace an already assigned Approver and/or Substitute, but to remove them you would have to remove them in Business Central.
In the page of the Approval Template, you can find which organization role has been assigned that template under the fasttab “Organization Roles”.
It is now possible to overrule the approval settings for a User on a user level. When you create an Authorization Request, you can select a user level Approval Template. This Template overrules the Approval Templates that are assigned to a User on an Organization Role level. So, when you have a temporary User, for instance an intern, you can assign the same Organization Roles as for a regular User and use a separate Approval Template to set the approval amount to €0,00.
With Free Fields you can define your own fields. These fields 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.
You can setup two types of Free Fields.
The setup of these two types of Free Fields are both the same.
Label : The description of the field.
Field Type : You can choose between; Text, Integer, Decimal, Date, Boolean and Option Field.
For the types Text, Integer and Decimal you can give up the Max Input Length.
For the Option Field you can give up options, separated by a comma.
The default values of Free Fields on Organization Roles can be filled with the backup functionality.
With the "Import Users per Organization Role” option via the organization chart, the default settings for Free Field values on Organization Roles are automatically used for new Organization Roles per User.
When adding an Organization Role to a User, only the Free Fields which are required are shown.
Free Fields of an Organization Role are also added to the Authorization Request API.
The backup also supports the “Use Business Central table to select data” fields to make it easier to use the backup and restore the complete Free Fields setup to another environment.
In the User card, there is the fasttab “Processed Actions” where you can find all the actions that have to do with Templates.
When clicking on the magnifying glass in that line, it will show the query which has to do with that template.
Or, when an error occurs on a synchronization task because of a query, you can find in this fasttab why that query was unsuccessful, as the column “Error Text” will describe why the query was not executed.
At this moment a few of our customers are testing the Beta version of our New template processor.
With the New template processor, the performance should increase significantly, as the templates of the same table are combined and processed in one single query.
This will mean much less traffic to Business Central.
The Authorization Box only changes data in Business Central if there is a difference in values in Business Central data and the values in the fields according to the Authorization Box.
All templates will now be processed with every synchronization action. This means the templates will also be processed during the daily night sync / authorization syncs, unlike the current template processor.
The changes in regards to the current template processor are as follows:
The sequence you add the templates to an organization role, are of no significance anymore. The New template processor checks which sequence has to be followed to successfully process the assigned templates in the authorization request. (if the fields in the templates themselves have been set up correctly)
When setting up a template, there is an additional option you can check when setting up templates called “Overwrite manually set values”.
Checking this checkbox will modify the values which are set for every template that applies to the same table and to the Default values.
Activating this option will set the value of all the table fields to the values as set in the Authorization Box, with and without a template.
If you have set values in a template, the values mentioned in the template will be set in Business Central.
If you have not set values for a field in a template, the value of those fields will be set in Business Central according the Default values and overwrite any value already set in Business Central.
For instance,
-- If this option is checked and you manually have set a value in Business Central for a Job title.
This field will be emptied (as per Default value) when there is no active template in the Authorization Box how to fill this field.
-- If this option is not checked, the value for the Job title in Business Central will remain as is.
Before setting up the templates, it is recommended to check the Default field values of the tables.
The list of tables in the Default values will be filled with tables of which a template was (or is) already active.
(new menu item : Authorization Framework=>Templates=>Default field values)
Here you can set the Conflict Resolution and if you would want to ignore the field of a table during the synchronization.
Conflict Resolution :
The conflict resolution is used to determine which value has priority when multiple templates assign a different value to the same field.
Default is “High over low”, optionally you can choose for “Low over high”.
This option is only available for fields of type Boolean, Integer and Option.
Boolean : False=lowest value, True=highest value.
Option : the first option is the lowest value, the last option the highest value.
Example: template 1 assigns Boolean1 = ‘true’, template 2 assigns Boolean2 = ‘false’.
If priority is Lowest value (option “Low over high”), and a user has both templates assigned, the setting used will be ‘false’.
Ignore during sync :
In case there is a field you never want to have the Authorization Box to change, you could opt to set the toggle “Ignore during sync” for that field in the Default values to “on”. This will only be effective in case the option of “Overwrite manually set values” has been chosen.