Notifications
Announcements
No record found.
class ABCD_CloseTaskWorkflowTypeApprovalManager { public static void main(Args args) { // TODO: Write code to execute once a work item is submitted. FormDataSource periodClosetask_ds; LedgerPeriodCloseProjectTask customWorkflowTable; WorkflowWorkItemTable workflowWorkItemTable; WorkflowComment note = ""; WorkflowSubmitDialog workflowSubmitDialog; WorkflowCorrelationId workflowCorrelationId; //multiSelectHelper = MultiSelectionHelper::construct(); periodClosetask_ds = FormDataUtil::getFormDataSource(args.record()); WorkflowTypeName workflowTypeName = workFlowTypeStr("ABCD_CLoseTaskWorkflowType"); //Opens the submit to workflow dialog. if (periodClosetask_ds.anyMarked()) { customWorkflowTable = args.record(); // Get comments from the submit to workflow dialog. note = "Note check !"; for(customWorkflowTable = periodClosetask_ds.getFirst(true)? periodClosetask_ds.getFirst(true) : periodClosetask_ds.cursor();customWorkflowTable;customWorkflowTable = periodClosetask_ds.getNext()) { try { if (customWorkflowTable.ABCD_WorkFlowStatus == ABCD_CloseTaskWorkFlowStatus::Submitted) { select firstonly workflowWorkItemTable where workflowWorkItemTable.Type == WorkflowWorkItemType::WorkItem && workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending // this should be Pending && WorkflowWorkItemTable.RefTableId == tableNum(LedgerPeriodCloseProjectTask) && WorkflowWorkItemTable.RefRecId == customWorkflowTable.RecId; WorkflowWorkItemActionManager::dispatchWorkItemAction(workflowWorkItemTable,note,curUserId(),WorkflowWorkItemActionType::Complete,menuItemActionStr(ABCD_CloseTaskWorkflowApprovalApprove),"WorkflowApproval"); } } catch (Exception::Error) { error("Error on workflow Approval !"); } } } periodClosetask_ds.reread(); periodClosetask_ds.research(true); periodClosetask_ds.refresh(); } }
Dialog dialog; DialogField field; ; dialog = new Dialog("Workflow comment"); dialog.addText("PLease provide a comment for the workflow approval"); field = dialog.addField(typeid(Notes)); dialog.run(); if (dialog.closedOk()) { note = field.value(); }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 456 Super User 2025 Season 2
Martin Dráb 429 Most Valuable Professional
BillurSamdancioglu 239 Most Valuable Professional