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)
WorkflowStepTable workFlowStepTableSequence, workFlowStepTable;
purchreqTable = purchreqTable::findPurchReqId('PR-010454');
select workItem order by RecId desc
where workItem.RefTableId == tableNum(purchReqTable) &&
workItem.RefRecId == purchreqtable.recid &&
workItem.Status != WorkFlowWorkItemStatus::Completed &&
workItem.UserId == 's.Wajahat'; // slect user to replace
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 == WORKFLOWTRACKINGSTATUSTABLE.RecId
while select WORKFLOWTRACKINGCOMMENTTABLE
where WORKFLOWTRACKINGCOMMENTTABLE.WorkflowTrackingTable == WORKFLOWTRACKINGTABLE.RecId
Hi all , Sharing is caring .I faced an issue when i was creating my first ever custom workflow i followed a Blog to create workflow , all went good but when i try to configure the workflow in order to test i was unable to find Approval item in workflow approval elements
It was not mentioned in that blog i followed nether i found its solution on internet so i decided to wrote about it.Its actually really simple .
Solution : Expand the Supported elements node of Workflow Type and drag and drop the Workflow Approval there.
That’s it . just save your settings close your client and re-open it. Bingo all done!
Today i faced an issue on client , error message they are having is
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 administrator for assistance.
The default language in Legal entity they are trying to run workflow is “FRENCH” while the work item subject is defined in Workflow configuration is in English, so when workflow trying to get the work item its get an empty value as it is other language! which causes workflow to stop.
Add a translation in all languages your are using (maybe the Company is in another language) in my case it was a company in FRENCH and the system was in English. Hope it will solve the issue
Below is the Job Snippet to get the Workflow Approver Name
static void workflowApproverInfo(Args _args)
while select workflowtrackingstatustable
order by RecId desc
where workflowtrackingstatustable.ContextRecId == 5637155826 //(Required Record)
&& workflowtrackingtable.TrackingContext == workflowtrackingcontext::WorkItem
&& workflowtrackingtable.TrackingType == workflowtrackingtype::Approval
&& workflowtrackingtable.WorkflowTrackingStatusTable == workflowtrackingstatustable .recid