Tuesday, 22 February 2022

Auto Submit Workflow in D365 F&O

DDDCustVendGlobal::submitToWorkflow(vendTable);

----------------------------------------------------------------------------

public static void submitToWorkflow(VendTable _vendtable)

{

WorkflowVersionTable workflowVersionTable = Workflow::findWorkflowConfigToActivateForType(workFlowTypeStr(VendTableChangeProposalWorkflow),  _vendtable.RecId,  _vendtable.TableId);

//If workflow is active then submit the workflow.

if (_vendtable.RecId && workflowVersionTable.RecId)

{

//submitting to workflow

Workflow::activateFromWorkflowType(workFlowTypeStr(VendTableChangeProposalWorkflow), _vendtable.RecId, "AutoSubmitWorkflow", false, curUserid());

      //Update the workflow status to Submitted on the table.

vendTable::updateWorkflowState(_vendtable.RecId, VendTableChangeProposalWorkflowState::Submitted);

}

No comments:

Post a Comment

DefaultDimension in d365 FO X++

 Navigate to PurchTable methods you can find with DefaultDimension this.DefaultDimension = this.mergeDimension(this.getDefaultDimension(),th...