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 :
Microsoft Dynamics AX (Archived)

How to add additional tokens in Hierarchy assignment?

(0) ShareShare
ReportReport
Posted on by 1,385

Hai Friends,

I need your valuable guidance for which I seek a solution in Workflow. In workflow editor, I am configuring for a bonus workflow. On selecting Step > Properties > Assignment > Assignment Type (tab), I am selecting Assign users to this workflow element as Hierarchy. In Hierarchy Selection, I am selecting Hierarchy Type as Managerial Type. In Start from: field, it lists Hierarchy tokens: Workflow Originator and Workflow Owner. I need to list additionally the following tokens: User ID or Person or Requestor option in it. I could see that options in User workflows.

Can you tell me how to add or list those options? Also tell me in which Class and/or AOT objects I need to do the modification(s)?

 

Thanks,

Aarvi

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,049 Super User 2025 Season 2 on at

    Hi Aavi,

    These tokens are developed in the workflow part called "Workflow providers". You can read more on MSDN. Start on this page: msdn.microsoft.com/.../cc586005.aspx.

  • arviax Profile Picture
    1,385 on at

    Thanks a lot André for your reply! I have read about "Workflow providers", but not able continue further. It tells that for Hierarchy assignment, I need to work on "WorkflowLimitHierarchyProvider" Class. It contains few methods like,

    WorkflowHierarchyProvider.getDataSource

    WorkflowHierarchyProvider.getNextNode

    WorkflowHierarchyProvider.getNodeDataType

    WorkflowHierarchyProvider.convertToNodeDataType

    WorkflowHierarchyProvider.convertUserIdToNodeDataType

    WorkflowHierarchyProvider.getSupportedDataType

    But in which method, I can give my own token value. Because the existing token values Workflow Originator and Workflow Owner are not there in any of the methods. Could you please how to proceed with this further?

    Thanks,

    Aarvi

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

    Hi Aarvi,

    You can find the logic in the class WorkflowLimitHierarchyProvider.

    Two methods are most likely needed to add new types:

    - getSupportedDataType

    - convertToNodeDataType

  • Community Member Profile Picture
    on at

    Hi Aarvi,  Did you end up finding a suitable solution to this and adding a new token into this class?

    Cheers,

    Jason

  • Suggested answer
    Community Member Profile Picture
    on at

    i had this requirement today and just added HCMworkerRecId in the two methods mentioned in Andre's post above (class WorkflowLimitHierarchyProvider).  After this you need to Generate Increment CIL and then go to Workflow , you would see 'Worker' option there.

    Below is the code section for both methods

    1) for getSupportedDataType - i added HCMWorkerRecId at the end.

    -----------------------------------------------------------------------------

       Set supportedDataTypes = new Set(Types::String);

       supportedDataTypes.add(extendedTypeStr(HcmPersonnelNumberId));

       supportedDataTypes.add(extendedTypeStr(UserId));

       supportedDataTypes.add(extendedTypeStr(DirPartyRecId));

       supportedDataTypes.add(extendedTypeStr(PurchReqPreparerRefRecId));

       supportedDataTypes.add(extendedTypeStr(PurchReqRequesterRefRecId));

       supportedDataTypes.add(extendedTypeStr(PurchRequester));

       supportedDataTypes.add(extendedTypeStr(TSWorker));

       supportedDataTypes.add(extendedTypeStr(TrvHcmWorkerRecId));

       supportedDataTypes.add(extendedTypeStr(HcmWorkerRecId));

       return supportedDataTypes;

    2) for  convertToNodeDataType  -  i added HCMworkerRecId at the end

    ------------------------------

    else if (  dictType.id() == extendedTypeNum(PurchReqPreparerRefRecId)

               || dictType.id() == extendedTypeNum(PurchReqRequesterRefRecId)

               || dictType.id() == extendedTypeNum(PurchRequester)

               || dictType.id() == extendedTypeNum(TSWorker) || dictType.isExtending(extendedTypeNum(TSWorker))

               || dictType.id() == extendedTypeNum(TrvHcmWorkerRecId)

               || dictType.id() == extendedTypeNum(HcmWorkerRecId)

    -------------------------------------------------------------------------------

  • Muhammad Afsar Khan Profile Picture
    2,676 on at

    I have same scenario and wanted to add Requester in Vendor invoice journal workflow, i tried this approach but requester field comes only in PO workflow. any idea how i can display Requester in 'Start from' drop-down for vendor invoice journal register workflow? 

  • naveen singh Profile Picture
    780 on at

    Hi Aarvi,

    Did you find any solution for this?

  • Max Hentschel Profile Picture
    70 on at

    Good afternoon all,

    i tried around today with this as well and came to a solution. 

    The approach of Aarvi is correct and working for me as well. 

    The only thing what is still worth to mention is that the field you refer to in the "getSupportedDataType"  needs to be also in the related source table.

    Means if you use purchase requisition line review, the field needs to be available in Table "PurchReqLine".

    In my example i added the DimensionDefault which is available in most of the tables and it worked perfectly fine.

    Muhammad Afsar Khan If you want to have this field available on the Supplier invoice workflow you need to make sure the requestor field is available and not a different ETD like on the PO Workflow.

    Max

  • Community Member Profile Picture
    on at

    Hi,

    I have followed the steps you mentioned. But i'm not able to see 'worker' option in the drop down start from field of the workflow.

    Could you please suggest me on this

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans