Using the “Managerial Hierarchy” option in workflows

Hi Guys,

As assured in my previous post, my post is here to explain about the “Manager Hierarchy” in workflow setups.
One of the common business requirements for the workflow approvals is to route the specific business document to the requesters’ managers for approvals. Ex: Purchase requisitions or Expense requests.

Scenario: client’s requirement is to configure the workflow in such a way that “When a purchase requisition is submitted by an employee, it must be routed to the person to whom the employee reports to”.

Let’s consider that the below screen shot is the reporting hierarchy for the employee. We are considering “James” persona for this demonstration. As per our example, we are configuring the workflow to route the Purchase requisition to Adam who is an immediate manager to James.
Position Hierarchy

As you already knew, we are obviously going to configure it using the “Managerial Hierarchy”.

-Managerial Hierarchy works based on the “position hierarchy” that is defined in the organization.

-Make sure that the employees used in the position hierarchy are linked with the corresponding Ax users in System administration>users form

-Position hierarchy will be built based on the “reports to position” field of the corresponding Position. To know how to create the position hierarchy – click this – Position Hierarchy

In the “workflow” step use the assignment type as “Hierarchy”
Assignment type - Hierarchy

Select the “Hierarchy type” as “Managerial Hierarchy”, set the “Start from” field as “Requester”. So that system starts finding the “Position hierarchy” from the person who is requesting the PR.
Workflow - Managerial Hierarchy

“Stop when the following condition is met”:
Basically, “Managerial hierarchy” routes the document to immediate reporting position. Once it is approved, it will be routed to the next manager, so it keeps routing it to the next manager in the hierarchy.

Using the “Stop when the following condition is met”, we should specify where it must stop the assignment. So, as per our position hierarchy, if James submits requisition, it goes to Adam, next to Alex and next to Sunny.
We are stopping the assignment using the “line manager level” condition which is set to 1 i.e. employee.line manager level = 1.

Above stop condition stops the assignment by assigning only to line manager of level1. The PR will be assigned only to the immediate position. As per the considered position hierarchy, it will be assigned to employee “Adam” and once Adam approves it the “PR status” will be shown as “Approved”

If the stop condition is set to “stop where employee.Line manager level =2”, the PR will be routed to Adam, and once Adam approves it, it will be routed to “Alex”.
Note: above explanation is in accordance with “Hierarchy options – “Assign to all users retrieved”.

Hierarchy options – “Assign to last user retrieved”:
Hieararchy options - Last user retrieved

Let’s go with below example.

If the stop condition is set to “stop where employee.Line manager level =2”, the PR will be routed to directly to Alex and it will not be routed to “Adam”. As the last user retrieved with hierarchy based on the above condition is “Alex”.
You have different options that can be used in “stop condition” as per the requirements.

Hope this post clearly explains how you can use the “Managerial hierarchy” in your workflows. Your suggestions and feedback are most welcoming.

Keep visiting and keep DAXing!!

In the next post, we are going to see how we can efficiently use the approval limits with Managerial hierarchies.
My next post addresses the below scenario which is requested by “Bhav” (one of the blog visitors). Below is Bhav’s requirement for your reference.

Have you tried to use an organisational hierarchy in a workflow? For example i’ve set up 3 users and assigned jobs, positions etc. and i assigned Spending limits to them through the policies in Org Admin (Trainee – upto $1000, Team Leader – More than $1000 but less than $5000, and Manager more than $5000 and upto $10,000). I was trying to replicate that if a requisition created by a trainee of $6000 it would bypass the second approver and go straight to the 3rd approver and stop there. This was only a demo, but i’m trying to replicate this with 5 levels of hierarchy. If you could help out with that, it would be fantastic!

Advertisements

38 thoughts on “Using the “Managerial Hierarchy” option in workflows

  1. Hi, first i’d like to thank you for this post.but i have a question.
    i want to make a condition if the direct line manager not senior position go to level 2 and if the direct line manager senior level go to level 1 .

  2. Hi Sunnysanthu,

    Thanks a lot for your response and i want to inform you that, the solution you sent to me by mail working fine and solve my problem. 🙂 again thanks for your quick support.

  3. I have this issue with the hierarchy workflow, I want to set up a workflow that goes to a particular position or job title. Each time I use that option, it uses the hierarchy on the position hierarchy and doesn’t go to the employee with that particular job or position title.

    Thanking you in anticipation of a quick response.

    • Hi Damola, I’m not sure whether you are still have this problem unresolved. If it is, please send me a detailed document on what you did so that I can help you out. Sorry for the delayed reply.

      • Thanks for the reply, the issue has not been resolved yet.

        What I did was during the workflow set-up, I specify hierarchy as the assignment type and the hierarchy selection is to stop where the employee job title is production director for instance. It doesn’t go to the production director as the first step in the approval process, it goes to the person who the employee is reporting to, instead of the production director that was specified.

        I even specified that it should exclude users whose job title is not production director, it did not work. What am I suppose to do to make it work.

  4. Damola, I think I understood your problem. Can you try one thing just set the stop condition “emloyee.Linemanagerleve = 5(assuming production director comes within the 5 level range)and leave the exclude users condition as it is. Just try this out and let me know, it it doesn’t work you can reach me on my skype santosh.kumar2827.

  5. Thank you Sunny, that is the problem, the employee serving as the admin doesn’t have the production director on his hierarchy. Our client is a big one&they have over a 100 people on their position hierarchy, so if one uses line mgr 5 for instance, might be just a manager for an employee in another department.

  6. hello,

    For this “For example i’ve set up 3 users and assigned jobs, positions etc. and i assigned Spending limits to them through the policies in Org Admin (Trainee – upto $1000, Team Leader – More than $1000 but less than $5000, and Manager more than $5000 and upto $10,000). I was trying to replicate that if a requisition created by a trainee of $6000 it would bypass the second approver and go straight to the 3rd approver and stop there. This was only a demo, but i’m trying to replicate this with 5 levels of hierarchy. If you could help out with that, it would be fantastic!”

    I think you can use the following for using only the first possible approver, independantly of the line level :

    Stop condition :
    WHERE Employee.approval limit.purchase requisition >= field Purchase requisition.approval amout exl tax

    and use option in hierarchy options “assign only to last user retrieved.

    Pierre

  7. Hello Sunnysanthu,

    What a great blog you have! I’ve learned using “Managerial Hierarchy” in your page. But I have a little consult that I want to make to you, maybe you can help me out.

    Using your example as my escenario, I’ve configure Hierarchy as you said. James makes a requisition, Adam has to approve it, Adam makes one and Alex approves it. But when is Alex’s turn, he makes a requisition (Sunny is the main authority, Sunny has to received it and approve it), i got a problem when the workflow runs, it stops working. Checking workflow history i get this error message:

    Stopped (error): X++ Exception: User not found
    at SysWorkflowHierarchyProvider-resolve
    SysWorkflowHierarchyProvider-resolveHierarchy
    SysWorkflowQueue-resume

    In the organization hierarchy, there a lot of positions like Alex’s one. I’ve tried with some of them and I get the same message

    Do you know what’s happening?

  8. Hi Sunny,
    First of all thanks a lot for useful info.
    I have a little doubt (you may feel very basic).. When I select item in PR lines I am not able to edit unit price & select vendor from vendor master, but when I select procurement category I can edit/enter unit price & can select vendor from vendor master. Why? Am I missing any setup?
    In case of Items, if I am unable to enter unit price, PR amount will always be zero unless m going through RFQ process. So, though PR is approved its amount will be 0 hence, if I set any rule for auto PO creation for PRs with minimum amount of say 5000 all PRs will be converted into PO.
    Also, can we setup PR workflow at legal entity level? (My client has 11 legal entities with different workflow requirement)
    Thanks a lot again

    • Hi Abhijit,

      You can’t edit the unit price as a requester because the price is defined by the organization and as a user you are not supposed to change the price. Also, you can change the vendor as an approver but not as a requester. For procurement category you can edit it.

      As organization sets up the price you wont run into a situation that all your POs would go with price-0.

      Thanks,
      Santosh

  9. Hi Sunny,

    Thanks for your post. It’s very useful to me. However I still have some questions that I cannot answer myself.

    1. Are there any difference if I select “Start from: Preparer” instead of “Start from: Requester” & at that time, the condition to route the purchase request (or expense request) to the department head should be like below:

    Where Employee.Job Title contains value “Dept Head”.

    2. Most of the time in my company, every time after a request is submitted, it will be routed to the requestor’s department head for approval. In my IT department, most of my requests are not related to my dept (IT), but to others because these expenses will be charged to these depts. (not IT). For examples, Training dept. request 20 Logitech corded mouses & this expense will be charged to Training dept (not IT). In this case, how I can specify in the workflow in order this request will be routed to Training Manager only for approval?

    Thanks
    Edward

    • Hi Edward,

      1. yes, there is a big different in using “Requester” and “Preparer”. It is suggested to use the “Requester” in your workflows rather than “Preparer”. Let’s assume a travel expense doc is being prepared by X(preparer) but for the person y(Requester), in this case the limit that he can spend and policies should be implied to him should be based on Y(Requester). So, in your workflows also, you can use the “Requester”

      2.
      I replied to your similar question in other thread i.e., you can think of using “Line level workflow”.

      If you are ready to go with line level workflow, system has the provision to enter the “department” for each line. As you are specifying the department code, you can route the Line1 to department1’s head and line2 to Department2.

      Alternatively, If you don’t want Line level workflow, you may try having a new customized field at the header to represent the department. And, as mentioned in the other reply, you would need to use each PR for a specific department.

      So, when you are requesting for “Training” department, you will select the “Training” as department and as per workflow configuration the PR’s with department “training” will be routed to Training department’s manager.

      • Hi Sunny,
        First of all, thanks for your post which is really useful.
        On top of this, I have question on selecting Requester.
        When creating PR, the requester is being defaulted. However, the drop down of requester have nothing for select except the Preparer himself. Is there any setting required for preparing request for others?

      • Hi Bowling, Glad that the post was helpful. Preparer must have the permission to request for someone else in the organization. This permission will be given using delegation capabilities. For example, Mr.Y can delegate his PR creation responsibilities to Mr. X. Then Mr. X can create the requisition for both the X and Y. To do this, GO to Procurement and sourcing> Setup> purchasing policies> Purchase requisition permissions

  10. Hi Sunny,

    By the way I have a question regarding workflow setup & hope you can help me. As I described my situation, to allow me to enter other departments that will charged based on their request amount, I have to setup me as worker for these departments other than IT dept. These department codes will be specified in the detail line of a request in the column “Receiving operating unit”. 01 request is for one department only. So if I have to buy 30 Logictech mouses for Training & Human Resources, I have to enter 02 purchase requests: 01 for Training & 01 for Human Resource. In this situation, please let me know how I can specify in the workflow so the system can route a request to Training or Human Resource based on Receiving operating unit in the detail line of request.

    Thanks so much,
    EdwardJD

    • Hi Edward,

      In the above case, where you want to the different lines to different department heads, you would need to create line level workflow. However, I don’t suggest that unless it is critical. The reason is, the approvers would need to approve each line.

      Alternatively, you can follow a procedure that each requisition will have each department’s requests. That means, if you are requesting for two departments, you will need to create two PRs.

  11. Hi Sunny,

    this blog had helped me a lot in resolving my present project’s requirement. i just found a current issue.
    Currently, their PR workflow has two level review/approval. From the preparer, the PR shall be reviewed by the preparer’s supervisor then approved by the preparer’s manager.

    Naturally, my workflow will have stop condition on the line managerial = 3.

    However, the client’s organization is a bit small and some employees has no reporting manager level 3. in this case, i am receiving the error for user not found.

    Anything i might be missing?

    Thanks,
    Mackie

    • Hi Mackie,

      I’m glad that the posts helped you. That’s a good requirement.

      what if we define two steps in the workflow? I’ve 10 employees who will have the line level managers upto 2 levels. Other employees with line level 3.

      Step1 – Condition> if the PR.requester is between 1 to 10, then in assignment stop condition is line manger =2

      step2 – condition> if the PR.requester is between 10 to 100, then in assignment stop condition is line manager = 3.

      I believe this should work. However, there can be some other ways of doing it too. This is something that is flashed in my mind simply.

      Regards,
      Santosh

  12. Hi Sunny,
    Thanks for you valuable post.

    Can you address my query below:

    This workflow is regarding the leave applications in an organization.
    Here some employee level 1 – reporting to Supervisor & reporting to Manager and level 2 has Senior Manager.
    My scenario is when an employee reports to supervisor then the workflow should go to level 2 to get final approval from senior manager. and if employee reports to manager then manager is the final approver.
    So I tried configuring line manager level “2”. and the exclude user with “Senior Manager” .

    But still the workflow goes to senior manager.

    Thanks
    Pradeep

    • Hi Pradeep,

      I don’t see any problem in the condition you mentioned. But, only thing I doubt is when you mentioned exclude user with “Senior Manager”, ensure that whether you are using employee.position title or Jobtitle field and also make sure that there is proper match on how you defined your position title/job title and how you mentioned in the condition.

      If you still face any problems, you can draft me an email with the positions setups and workflow conditions. I will try my best to help you out.

      Regards,
      Santosh – santoshdurgam.kumar@gmail.com

  13. Hi Sunny,
    Thanks for sharing this great experience which helps me a lot.
    I have a little question on the workflow setup, I found that if I use the “Requester” in “Hierarchy selection -> Starts from”, I’ll get an error says cannot find worker. But if I use “workflow originator”, everything works fine. Do you know if I have something setup wrongly to cause this problem?
    I’m using AX 2012 Feature Pack.

  14. Spend days wondering why AX2012 R3 workflow did not STOP at the set Stop-condition… I tried to set the stop condition on a employee.jobtitle with a string as a value: IT DOES NOT WORK! Use another employee field. Linelevel works, maybe because it’s an integer…

  15. Hi Sunny,

    Thank you for your blog, this has really helped me with my client. Now I have a new requirement, maybe a little bit more complex where they need approval based on financial dimensions.

    Lets say that each PR line post to different Financial Dimensions and each Financial Dimension uses a department, I want to know if there is a possibility to use Financial Dimensions to go to different managers within a department.

    Please let me know if you have any ideas of how I can configure the workflow that way.

    Thanks!

  16. Sunny,
    I was just introduced to your site a few hours ago. Great post and insight. We are in the process of configuring our system. I’m attempting to create a workflow using Approval Limits in lieu of Line Levels. Employee’s all have positions and those positions (jobs) have been set with Approval Values. I cannot get my PR’s to stop at the correct managerial approval amount. We have large dollar value PR’s and will need to go as high as 5 levels of approvals. Based on your example, can you assist me with the directive for approval level. Thank you so very much.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s