Tuesday, February 4, 2025

Workflow step name x++

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


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;

}

No comments:

Post a Comment