Step name of Workflow

Below is the reference sample code to get the workflow step name. public display str 25 stepName(PurchReqTable _purchReqTable) { container con; PurchReqTable purchReqTable; PurchReqTableHistory purchReqTableHistory; WorkflowTrackingStatusTable workflowTrackingStatus; WorkflowTrackingTable workflowTracking; utcdatetime validDate = DateTimeUtil::utcNow(); WorkflowStepName stepName; TransDate stepSinceDate; PurchReqRequisitionStatus status; TransDate statusSinceDate; RefRecId workflowTrackingStatusRecId; RefRecId workflowStepRecId; UserInfo userInfo; WorkflowTrackingTable workflowTrackingLocal,workflowTrackingLocal2,workflowTrackingLocal3; WorkflowStepTable workflowstepTable; RefRecId _purchReqTableRecId = _purchReqTable.RecId; […]

Replace \ Delegate Workflow User

With this piece of Code we can delegate Workflow from One User to another Using X++ Here I am taking example of Purchase Requistion static void waj_replaceWorkflowUser(Args _args) { workflowtrackingstatustable workflowtrackingstatustable; workflowtrackingtable workflowtrackingtable; PurchReqTable purchreqTable; WorkflowWorkItemTable workItem; WorkflowStepTable workFlowStepTableSequence, workFlowStepTable; WORKFLOWTRACKINGCOMMENTTABLE WORKFLOWTRACKINGCOMMENTTABLE; purchreqTable = purchreqTable::findPurchReqId(‘PR-010454’); select workItem order by RecId desc where workItem.RefTableId == tableNum(purchReqTable) […]

Get Comments of a Workflow

We can use this sample code to get the workflow comments on particular Record. Project budget is my desired table  . you can replace ProjBudget to any other table on which you want to get the entered comments. while select WORKFLOWTRACKINGSTATUSTABLE where WORKFLOWTRACKINGSTATUSTABLE.ContextRecId == projBudget.RecId  // && WORKFLOWTRACKINGSTATUSTABLE.ContextTableId == tableNum(ProjBudget) { while select WORKFLOWTRACKINGTABLE where WORKFLOWTRACKINGTABLE.WorkflowTrackingStatusTable […]

Error in Workflow

Hi all, Today i faced an issue on client , error message they are having is Issue : The text associated with this work item cannot be found in the assignee’s language, or in the default language for the system or legal entity. The workflow has stopped processing because of this error. Contact your system […]

Workflow Approver NAME

Below is the Job Snippet to get the Workflow Approver Name static void workflowApproverInfo(Args _args) { WorkflowTrackingStatusTable workflowtrackingstatustable; WorkflowTrackingTable workflowtrackingtable; while select workflowtrackingstatustable order by RecId desc join workflowtrackingtable where workflowtrackingstatustable.ContextRecId == 5637155826 //(Required Record) && workflowtrackingtable.TrackingContext == workflowtrackingcontext::WorkItem && workflowtrackingtable.TrackingType == workflowtrackingtype::Approval && workflowtrackingtable.WorkflowTrackingStatusTable == workflowtrackingstatustable .recid { info(workflowtrackingtable.User); info(HcmWorker::find(DirPersonUser::findUserWorkerReference(workflowtrackingtable.User)).name()); } }