How to get the lastest workflow approved name in AX2012?

add the display method under the table methods nodes.

public display WorkflowStatusUserName getApproverUserName()
{
    WorkflowTrackingStatusTable     trackingStatusTable;
    WorkflowTrackingTable           workflowTrackingTable;
    ;

    select firstOnly User from  workflowTrackingTable
            order by CreatedDateTime desc, RecId desc
            where workflowTrackingTable.TrackingContext == WorkflowTrackingContext::WorkItem                    &&
                  workflowTrackingTable.TrackingType    == WorkflowTrackingType::Approval
        exists join trackingStatusTable
            where trackingStatusTable.RecId             == workflowTrackingTable.WorkflowTrackingStatusTable    &&
                  trackingStatusTable.ContextTableId    == this.TableId                                         &&
                  trackingStatusTable.ContextRecId      == this.RecId;

    return SysWorkflowHelper::getDirPartyNameFromUserId(workflowTrackingTable.User);
}

 

posted @ 2013-03-08 21:05  Fandy Xie  Views(470)  Comments(0Edit  收藏  举报