Get workflow pending Approval Name using x++ in D365FO.
display HcmWorkerName displayWorkflowApproverName()
{
WorkflowWorkItemTable workItemTable;
select workItemTable
where workItemTable.RefRecId == this.RecId
&& workItemTable.RefTableId == this.TableId &&
((workItemTable.Status == WorkflowWorkItemStatus::Pending)
|| (workItemTable.Status == WorkflowWorkItemStatus::Delegated));
return HcmWorker::find(HcmWorker::userId2Worker(workItemTable.UserId)).name();
}
Keep Daxing!!
No comments:
Post a Comment