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

  • Community Member Profile Picture
    on at
    RE: How to add additional tokens in Hierarchy assignment?

    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

  • Max Hentschel Profile Picture
    70 on at
    RE: How to add additional tokens in Hierarchy assignment?

    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

  • naveen singh Profile Picture
    780 on at
    RE: How to add additional tokens in Hierarchy assignment?

    Hi Aarvi,

    Did you find any solution for this?

  • Muhammad Afsar Khan Profile Picture
    2,676 on at
    RE: How to add additional tokens in Hierarchy assignment?

    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? 

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to add additional tokens in Hierarchy assignment?

    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)

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

  • Community Member Profile Picture
    on at
    RE: How to add additional tokens in Hierarchy assignment?

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

    Cheers,

    Jason

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    294,715 Super User 2025 Season 1 on at
    RE: How to add additional tokens in Hierarchy assignment?

    Hi Aarvi,

    You can find the logic in the class WorkflowLimitHierarchyProvider.

    Two methods are most likely needed to add new types:

    - getSupportedDataType

    - convertToNodeDataType

  • arviax Profile Picture
    1,385 on at
    RE: How to add additional tokens in Hierarchy assignment?

    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
    294,715 Super User 2025 Season 1 on at
    RE: How to add additional tokens in Hierarchy assignment?

    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans