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

Notifications

Announcements

Community site session details

Community site session details

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

workflow step name

(0) ShareShare
ReportReport
Posted on by 131

Hello,

I need to fetch the name of the "Step" of the workflow. 

For example:

In my workflow,  step1 : approved by teamlead (name of step)

step2: approved by manager (name of step)

so, I need to show the name i.e: approved by teamleader

can anyone help with the code and relation to acheive this?

Thankyou 

AyuSri.

I have the same question (0)
  • Suggested answer
    Komi Siabi Profile Picture
    13,190 Most Valuable Professional on at

    Hello AyuSri,

    You can use this to get the step.

    Here, we try to get the current step of the workkflow during the approval process.

    public display Description currentStep()
    {
        WorkflowTrackingTable             trackingTable;
        WorkflowTrackingStatusTable       trackingStatusTable;
    
        select RecId, User,Name, CreatedDateTime from trackingTable
        order by CreatedDateTime desc where
         trackingTable.TrackingType == WorkflowTrackingType::Creation &&
         trackingTable.TrackingContext == WorkflowTrackingContext::Step
        join trackingStatusTable
        where trackingTable.WorkflowTrackingStatusTable == trackingStatusTable.RecId &&
            trackingStatusTable.ContextRecId == this.RecId &&
            trackingStatusTable.ContextTableId == this.TableId;
    
        return trackingTable.Name;
    
    }

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Aayushii, I think you are referring to 'Name' field in WorkflowTrackingTable table. If yes, then you can leverage the below code to find the workflow approval step.

    daxingwitheshant.blogspot.com/.../x-code-to-return-workflow-approver-name.html

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 663 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 289 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 232 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans