Skip to main content

Import data from the details object in the main flow's form to the details object in the subflow's main form

When a sub-process is started, if it is desired to transfer the data in the details in the form in the main flow to the details object in a form of the sub-process, this process can be achieved by adapting the underlying code.

''To project references %SystemPath%\Common\eBAPI.dll %SystemPath%\Common\eBAIntegrationAPI.dll

using eBAPI.Connection; using eBAPI.Workflow;

eBAConnection con = CreateServerConnection(); Con. open(); eBAForm frm = new eBAForm(Document1.ProfileId); The id of the form of the subflow eBAForm anafrm = new eBAForm(vrbAnaFormId.Value); ID of the form of the main stream FormDetails dtl = frm. Details["NewSupplierDefinedTable"]; Name of the details in the form of the subflow FormDetails dtlAna = anafrm. Details["NewSupplierDefinedTable"]; Name of the details in the form of the main flow

Try { foreach foreach(FormDetailsRow fdr in dtlAna.Rows) //Details in the main feed's form { WorkflowManager mng = con. WorkflowManager; eBAForm dtlForm = fdr. Form; The modal form of the row we are on while navigating through the lines of the details in the form of the main flow. WorkflowDocument doc = mng. CreateDocument("ParameterForms", "Form1");// the first parameter is the project name, and the second parameter is the modal form name that depends on the details eBAForm modalForm = new eBAForm(doc. DocumentId); modalForm.Fields["supplier_Unvan"]. AsString = dtlForm.Fields["Title"]. AsString; modalForm.Fields["supplier_vkn"]. AsString = dtlForm.Fields["VKN"]. AsString; modalForm.Update(); Dtl. Rows.Add(doc. DocumentId); } //You will need to adapt this code within the details object inside the details of the subflow

} catch (Exception e) { throw new Exception(e.ToString()); } finally { frm. Update(); Con. Close(); }```