Pages

Banner 468 x 60px

 

Thursday, April 19, 2018

Get workflow information using x++

0 comments
Hi Guys, I share how to Get Workflow Information AX using X++ :

Get workflow information using x++ :

Display str ApproveDate()
{
    WorkflowTrackingStatusTable     workflowTrackingStatus;
    WorkflowTrackingTable           workflowTrackingTable;
    WorkflowTrackingCommentTable    workflowTrackingCommentTable;
    UserInfo                        userInfo;
    Name                            _name;

    select firstFast RecId, User from workflowTrackingTable
    order by RecId desc
    join workflowTrackingCommentTable
    where workflowTrackingCommentTable.WorkflowTrackingTable == workflowTrackingTable.RecId
    join UserInfo
    where UserInfo.id == WorkflowTrackingTable.User
    exists join workflowTrackingStatus
    where workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatus.RecId
    && workflowTrackingStatus.ContextRecId == _getPR.RecId
    && workflowTrackingStatus.ContextTableId == tableNum(PurchreqTable) //PurchTable
    && workflowTrackingTable.TrackingType == WorkflowTrackingType::Approval;
    if (workflowTrackingTable.RecId > 0)
    {
        return ": " + strFmt('Approve Date : %1 - Approve Name : %2',  datetime2str(workflowTrackingCommentTable.createdDateTime,123), userInfo.name);
    }
    else
    {
        return '';
    }
}

Ask me if you have a problem, please email to : adityomagnet@gmail.com

0 comments:

A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record

  SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account  :  and Delete the Bank Account FINISH