web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Ax2012 workflow issue probable bug

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a approval journal workfllow in GL module with 1 step of assigning work item to  manager of the workflow originator. It works fine for normal scenarios.

However when user A who is assigned to worker A & position A & has none in " report to " section (basically no reporting manager) ,  submits GL for apporval. The workflow get assigns to worker B .

Ideally it should error out as the report to section was blank & never assigned to worker B.

What can i do to ensure any 1 of the following

A>User  who has report to as blank should not be able to submit JE to workflow OR

B>If user who has report to as blank is submitting items to workflow, then workflow should error out instead of assigning it to worker B .

Thanks

Mav

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    Could you please share the Hierarchy selection and hierarchy option setup for the workflow?

  • Mav Profile Picture
    on at

    pastedimage1599593432438v1.png

    Thanks

    Mav

  • Mav Profile Picture
    on at

    I am unable to step into this _workItemContext.get_User()  while debugging , which type is Microsoft.Dynamics.AX.Framework.Workflow.Runtime.WorkItemActivityContext .

    This is the method which is returning user B as default value for all users who have no report to /line manager assigned. 

    Even for line 66 , i can see user B listed under user for _workitemcontext.

    The workflow seems to execute like below.

    Users create request --> Submit to workflow -->Workflow engine check for line manager --> If no line manager found assigns to User B --> If user B has security rights work item is created for User b to approve & 

    if User B does not have access rights, then workflow engine throws cannot create work item for user b error.

    This appears to be a security bug , especially if User B has right to approve stuff. 

    Please share how can i achieve either of objectives shared in earlier post.

    pastedimage1599596799080v1.png

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Mav,

    Can you tell a bit more about user B? What settings does this user have? Is this user part of the position hierarchy?

    In my experience, the workflow stopped with an error when there was no user found in the managerial hierarchy.

  • Mav Profile Picture
    on at

    Setting wise it is set like any other user in Ax, i.e. user having association to worker having association to a position.

    As the user is assigned to a position , it is part of position hierarchy . 

    So i have tried recalling  & resubmiting the workflow several times The value of userid (2nd highlighted item in red i n below pic)  changes to USER C (manager of USER A) when i put user C in report to position A of User A & everything works as expected. However the  value of userid  changes to USER B when i remove USER C from report to position of USER A , i.e. USER A having no reporting to/line manager.  ideally this is when it should error out stating no report to/user found for user A, not sure why it keeps going to USER B for all users who have blank report to position.

    pastedimage1599600016629v2.png

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Mav,

    Is user B a manager above user C and A? Have you also tried to debug the hierarchy provider logic why it comes with user B? Have you checked if you have a customization for a fallback user?

  • Mav Profile Picture
    on at

    Just checked that i have inactive position which is tied to a worker B.

    So for some reason ( i have deep dive more in debugging) when user A who has no manager assigned to it submits an item , it fetches this inactive position in hierarchy provider logic as default position for user A & so for all other users who do not have any manager assigned to themselves .

    Ideally the system should never get position details from inactive positions, correct ?

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello Mav,

    Just for curiosity because I recently experienced something related, can you check the user setup and verify that there is no delegation in place that might cause the issue here?

    Best regards,

    Ludwig

  • Mav Profile Picture
    on at

    Hi Ludwig,

    Thanks for your reply, yep that is 1 of the 1st thing i checked & there are no delegation setup in my case.

    Shared below are steps to recreate this issue.

    1>Create simple workflow with approval step configured to use line manager .

    2>Submit the workflow from user A , ensure user A has no report to position assigned in HR position detail form,

    3>Have user B tied to a "inactive position" in Ax.

    4>Submit the item to the workflow via user A.

    5>Expected case should be that workflow should error as there is no manager assigned to user A.

    6>However what will happen is you will see that workflow get assigned to user B who has no relation to user A.

    Ideally the system should not return anything in hierarchy provider logic because user A has no manager assigned , additionally it should not return user B 's inactive position in hierarchy provider logic .

    Thanks

    Mav

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Mav,

    I would not expect that an inactive position would be used here. Can you share a screenshot with all validity dates of this position?

    Is user B still an active user?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans