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)

Need to get workflow approvers list using x++

(0) ShareShare
ReportReport
Posted on by 995

Hi all,

How can I get the approvers list for a workflow using X++ code though the record is not submitted for workflow.

New-1.PNG

I need get the selected list(i.e.,Admin) to the corresponding workflow.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You might get some idea from the below blog, it does list approvers for a specific PO:

    nairobiaxusergroup.wordpress.com/.../getting-workflow-approvers-in-dynamics-ax-ax-2012

    Or did you mean to fetch it for the actual setup?

  • AX Techie Profile Picture
    995 on at

    Hi Vilmos,

    Those tables will track details after the workflow starts. But I need to get the details when I assign the users, irrespective of workflow initiation.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Edit: refer to below post.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    I have set up a new workflow in my Test environment and in the AX Developer client I have checked the Tools menu > Number of records > filter by *workflow*.

    I have found that the WorkflowAssignmentTable has multiple records created, and one of the column among the records, UserValue has the semicolon-separated list of assigned accounts as approvers.

  • AX Techie Profile Picture
    995 on at

    Exactly Vilmos.... But I must consider version(activated) too. So could you give the details to get. Means I have created WF with users user1 under version1, next I created with version2 with user1;user2. Can you help me out please...

  • Verified answer
    AX Techie Profile Picture
    995 on at

    Finally found, below worked for me....

    WorkflowTable           workflowTable;

       WorkflowVersionTable    workflowVersionTable;

       WorkflowElementTable    workflowElementTable;

       WorkflowStepTable       workflowStepTable;

       WorkflowAssignmentTable workflowAssignmentTable;

       while select workflowAssignmentTable

               join workflowStepTable

              where workflowStepTable.RecId == workflowAssignmentTable.workflowStepTable

               join workflowElementTable

              where workflowElementTable.ElementId == workflowStepTable.ElementId

               join workflowVersionTable

              where workflowVersionTable.ConfigurationId == workflowElementTable.ConfigurationId

                 && workflowVersionTable.Enabled == NoYes::Yes

               join workflowTable

              where workflowTable.RecId == workflowVersionTable.workflowTable

                 && workflowTable.DocumentTableName == "SalesQuotationTable"

       {

           info(strFmt("%1", workflowAssignmentTable.UserValue));

       }

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