cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP B1 Addon Grid Error {"Data Table - invalid Unique Id [66000-138]"}

attakorn_t
Explorer
0 Likes
289

I am creating ADDON with SAPbouiCOM.Grid by converting a Data Table into a Grid, but I encountered the error 'Data Table - invalid Unique Id [66000-138]' at the line Grid1.DataTable = oDT. Could anyone help me resolve this issue? Below is the sample code I am using.

SAPbouiCOM.Form oForm = SBO_Application.Forms.ActiveForm;

SAPbouiCOM.DataTable oDT;

oDT = oForm.DataSources.DataTables.Add("dt_GridData");

oDT.Clear();

if (oDT.Columns.Count == 0)

{

oDT.Columns.Add("Branch", SAPbouiCOM.BoFieldsType.ft_AlphaNumeric, 50);

}

foreach (XmlNode node in nodes)

{

System.Data.DataRow oVatRow = dt_output_vat.NewRow();

oVatRow["Branch"] = node.SelectSingleNode("JDT1_U_CompBranch").InnerText.ToString();

dt_output_vat.Rows.Add(oVatRow);

int rowIndex = oDT.Rows.Count;

oDT.Rows.Add();

oDT.SetValue("Branch", rowIndex, oVatRow["Branch"].ToString());

irow++;

}

Grid1.DataTable = oDT;

Grid1.AutoResizeColumns();



Best Regards.

Accepted Solutions (0)

Answers (0)