Dear All,
I have a requirement where in Webservice consuming application (.Net application) is sending multiple records to NAV. I am using a codeunit in NAV which has XMLPort as a Parameter (VAR). Below is the .Net Application code :
RootDimensions RootDim = new RootDimensions();
List<Dimension> DimList = new List<Dimension>();
if (dimInputCode.Text != "" && dimInputName.Text != "")
{
Dimension Dim = new Dimension();
Dim.DimensionCode = "AREA";
Dim.Code = "1000";
Dim.Name = "1000";
DimList.Add(Dim);
Dim = new Dimension();
Dim.Code = "1003";// dimInputCode.Text;
Dim.Name = "1003"; // dimInputName.Text;
Then we add the single dimension to our list
DimList.Add(Dim);
//To get the list of dimensions "attached" to the root element, we use the following
RootDim.Dimension = DimList.ToArray();
try
{
//Then we send to NAV and show our result
ResultLabel.Text = NAVImport.ImportDim(ref RootDim);
DimList.Clear();
}
catch (Exception ex)
{
//Show a possible exception
ResultLabel.Text = ex.ToString();
}
But when the system reads, the array contains only the last records but twice.
Any idea as to how to read multiple records using Webservice in NAV 2013 R2.
Best Regards,
MMV
0
Answers
The above code works well for a single record. But when I tried to add multiple records, it adds only the last record in the List array.
Best Regards,
MMV
Thank you for your reply. What is this ReadMultiple? I am using a Codeunit which is exposed and the Codeunit has a function "ImportData" which has a XMLPort parameter.
Could you explain me in little more detail?
Best Regards,
MMV
I did exactly what you said except that I wanted to insert the data in NAV so I used CreateMultiple and it worked.
Thanks a lot.
=D> =D> =D>
Best Regards,
MMV