Wednesday, 18 May 2016

WorkFlow Approver Name and Date Time

HI, Below code used to get workflow approve name based on purchase order Id or RecId.

select firstonly workflowTrackingStatusTable
order by RecId desc
where workflowTrackingStatusTable.ContextTableId == tableNum(PurchTable)
&& workflowTrackingStatusTable.ContextRecId == purchTable.RecId
&& workflowTrackingStatusTable.TrackingStatus == WorkflowTrackingStatus::Completed;
select * from workflowTrackingTable
order by CreatedDateTime desc, RecId desc
where workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatusTable.RecId
&& workflowTrackingTable.TrackingContext == WorkflowTrackingContext::WorkItem
&& workflowTrackingTable.TrackingType == WorkflowTrackingType::Approval;
select firstOnly dirPersonUser
order by ValidTo desc
where dirPersonUser.User == workflowTrackingTable.User;
select dirPerson
where dirPerson.RecId == dirPersonUser.PersonParty
join hcmWorker
where hcmWorker.Person == dirPerson.RecId;
select hcmPositionWorkerAssignment
order by ValidTo desc
where hcmPositionWorkerAssignment.Worker == hcmWorker.RecId
join hcmPosition
where hcmPosition.RecId == hcmPositionWorkerAssignment.Position;
name = dirPerson.Name;
select * from workflowTrackingCommentTable where workflowTrackingCommentTable.WorkflowTrackingTable == workflowTrackingTable.RecId;
approvedBy = strFmt(“@SYS3492” + ‘ < %1, %2 – %3 >’, name,
DateTimeUtil::applyTimeZoneOffset(workflowTrackingCommentTable.createdDateTime, DateTimeUtil::getCompanyTimeZone()));

1 comment:

  1. I need Ax 2012 TEch training.Please contact


Excel data connector in AX7/D365

Excel data connector in AX7: Configuring and using the Excel Data Connector Add-in The Excel Data Connector add-in is built by usi...