Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

workflow step name

(0) ShareShare
ReportReport
Posted on by 129

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.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: workflow step name

    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

  • Verified answer
    Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    RE: workflow step name

    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;
    
    }

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans