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.

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.

You can find more information on Technet:

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.

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.

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

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.

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.

I do hope you liked this post and will add value for you in your daily work as a professional. If you have related questions or feedback, don’t hesitate to use the Comment feature below.

That’s all for now. Till next time!

3 replies
  1. Michel
    Michel says:

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


    • André Arnaud de Calavon
      André Arnaud de Calavon says:

      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 Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.