WorkflowVersionTable workflowVersionTable;
//Check whether we have a Active workflow on the table.
workflowVersionTable = Workflow::findWorkflowConfigToActivateForType(workFlowTypeStr(KMTSalesAgreementLineWFType),
agreementLine.RecId,
agreementLine.TableId);
//If workflow is active then submit the workflow.
if (agreementLine.RecId && workflowVersionTable.RecId)
{
//submitting to workflow
Workflow::activateFromWorkflowType( workFlowTypeStr(KMTSalesAgreementLineWFType),
agreementLine.RecId,
"@KMT_Label:AutoSubmitWorkflow",
false,
curUserid());
//Update the workflow status to Submitted on the table.
salesAgreementHeader::updateWorkflowStatus(agreementLine.RecId,
KMTSalesAgreementWFStatus::Submitted,
NoYes::No);
}