Hi All,
I have a repeating group called 'NominalCoding' that has fields 'NominalAccount', 'CostCentre', 'Department' and 'Net'
I also have a script that creates a dataset which includes the data to fill out each iteration of 'NominalCoding' repeating group.
How do I create a new iteration of the repeating group 'NominalCoding' and get the current instance number to be able to use to fill data into 'NominalAccount', 'CostCentre', 'Department' and 'Net' from the dataset?
Code I'm using to get the data
Many thanks
Richard
I have a repeating group called 'NominalCoding' that has fields 'NominalAccount', 'CostCentre', 'Department' and 'Net'
I also have a script that creates a dataset which includes the data to fill out each iteration of 'NominalCoding' repeating group.
How do I create a new iteration of the repeating group 'NominalCoding' and get the current instance number to be able to use to fill data into 'NominalAccount', 'CostCentre', 'Department' and 'Net' from the dataset?
Code I'm using to get the data
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient
using System.Windows.Forms;
using System.Data.Odbc;
using System.Xml;
string varPONumber = Context.Field("OrderNumber").Text;
string SEL_COM = "Select NominalAccountRef, NominalCostCentre, NominalDepartment, LineTotalValue from vw_flexicapture_orderlinelist where PONumber =" + "\'" + varPONumber + "\'";
string CON_STRING = "Server=*****;Database=****;Uid=*****;Pwd=*****;";
//create list to house companies
List listnominalAccount = new List();
List listcostCentre = new List();
List listdepartment = new List();
List listnet = new List();
//connect to sql to parse all possible companies user has access to
SqlDataAdapter sqlAdapter = null;
sqlAdapter = new SqlDataAdapter(SEL_COM, CON_STRING);
DataSet nominals = new DataSet();
sqlAdapter.Fill(nominals, "Nominals");
foreach (DataTable table in nominals.Tables)
{
foreach (DataRow row in table.Rows)
{
string varNominalAccount = row["NominalAccountRef"].ToString();
varNominalAccount = varNominalAccount.Trim();
listnominalAccount.Add(varNominalAccount);
string varCostCentre = row["NominalCostCentre"].ToString();
varCostCentre = varCostCentre.Trim();
listcostCentre.Add(varCostCentre);
string varDepartment = row["NominalDepartment"].ToString();
varDepartment = varDepartment.Trim();
listdepartment.Add(varDepartment);
string varNet = row["LineTotalValue"].ToString();
varNet = varNet.Trim();
listnet.Add(varNet);
}
}
Many thanks
Richard
Comments
3 comments
Trying to use
But getting error:
AddNominalCoding:System.NotImplementedException
But no new instances added
Put it the workflow after the recognition stage and before the verification stage.
Please sign in to leave a comment.