Jan 14, 2014 by André Arnaud de Calavon Category: AX2012, AX2012 R2 5 comments Tags: Security

Last time I wrote about the standard batch jobs in AX and promised to come back on the automatic role assignment in Microsoft Dynamics AX 2012. I will explain two examples. One example will be based on using a query out of the box. The second will be described in my next post and will give an example how to create a new query for this feature.

Automatic role assignment

First a quick overview of the automatic role assignment. When a rule has been added the batch job will periodically check whether users should be added or removed from a role. In the next example some people are assigned automatically because of the rule. You can also add users manually. Also on this form a button exists for executing the automatic role assignment. This will then run immediately for the current selected role.

AssignRole1-3

When specifying the rule, you can also assign organizations to limit the number of companies where the role applies. If the user is added automatically you cannot override the assigned organizations for this user.

When persons needs to be excluded which were added automatically, you can Remove this user or use the Manage assign/exclude form. In the picture below you will notice that PRAKASH was excluded manually. When the automatic assignment job checks this role again, the manual excluded users will be skipped.

AssignRole1-4

You can find more information on Technet: http://technet.microsoft.com/en-us/library/gg751367.aspx

Adding Project timesheet user role

The sample for this post is adding users to the role Project timesheet user. There could be a business scenario when the Project setup contains a value in the field Period code, the user is supposed to write time and thus requires access to the timesheets in the Dynamics AX client or the Employee Selfservice. They can also use mobile apps for Microsoft Dynamics AX for managing their timesheets. Recently I wrote a review on the Timesheet and Expense management apps.

AssignRole1-1

A user can have a relation with a person in AX (global address book record). This person is linked to the worker. The worker is linked in the project setup table. This is show in the datamodel below.

AssignRole1-2b

When creating the automatic role assignment the query ‘Select all users‘ can be used as source query.

AssignRole1-5

Click Edit query to open an advanced query form where we can specify the criteria. We have to add the tables by right click the existing table and choose to add the tables based on the relation. The period code field wil be filled to have excluded Project worker records where this field is empty or specify a value.

AssignRole1-7

Click OK. Then wait for the batch job picked up the new rule or run the assignment manually. The users will be added based on the above criteria.

AssignRole1-8

That’s all for now. Till next time!

Microsoft Dynamics AX CommunitySubscribe to this blogger RSS Feed

Comments5
  1. MichelApril 25, 2014   

    Hi
    When I am in the Inquiry window, I am not able to add tables as you do. What is missing ?

    Thanks

  2. MichelApril 25, 2014   

    OK. I found the answer in part 2. Great!!

    Michael

    • André Arnaud de CalavonApril 27, 2014   

      Hi Michel,

      Thanks for reading the blogs. Indeed some tables cannot be linked using the advanced query form and you will have to create a new query for this.

Leave a Comment!

Your email address will not be published. Required fields are marked *