Skip to Content
1
Former Member
Jun 08, 2017 at 10:00 AM

how to insert data into User defined table in sap B1 Sdk C#

2170 Views

hi

I am trying to Insert Data into User defined Table in Database.

I wrote like this

SAPbobsCOM.UserTable oUserTable; oUserTable = Ocompany.UserTables.Item("U_Registrations"); oUserTable.UserFields.Fields.Item("RowId").Value = 1; oUserTable.UserFields.Fields.Item("Name").Value = txtName.Text; oUserTable.UserFields.Fields.Item("ContactNo").Value = txtContactNo.Text; oUserTable.UserFields.Fields.Item("DOB").Value = txtDOB.Text; oUserTable.UserFields.Fields.Item("Age").Value = txtAge.Text;

oUserTable.Add();

I am getting error : Invalid field name error in this line

SAPbobsCOM.UserTable oUserTable; oUserTable = Ocompany.UserTables.Item("U_Registrations");

how to resolve this.can any one suggest me?