on 2020 May 11 6:33 AM
Hi,
I am new to SAP B1 SDK and I have been trying to insert record into an UDT of document type. I retrieve the Purchase Order number in the edit text field using Choose From List which works fine.
But I get 'Invalid Field Name' when adding the record. I debugged the code and it shows the error at this code piece,
oUserTable = oCompany.UserTables.Item("TEST"); // Debug line- 'Invalid Field Name'
Here's my full code and image of the udf:
public Company oCompany;
public UserTable oUserTable;
private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
{
BubbleEvent = true;
oCompany = new Company();
oUserTable = null;
oUserTable = oCompany.UserTables.Item("TEST"); // Debug line- 'Invalid Field Name'
oUserTable.Code = Convert.ToString(1);
oUserTable.UserFields.Fields.Item("U_PONo").Value = EditText0.Value;
oUserTable.Add();
oUserTable = null;
GC.Collect();
}
User | Count |
---|---|
116 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.