Wokflow 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()));


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s