Hi All,
I am trying to create a user defined form using SAP B1 Studio for VS. I am able to load the form and add and find data using UDO. I want to display the next document number on the form when the form is loaded. But I am getting Invalid Item error.
oForm = ((SAPbouiCOM.Form)(Application.SBO_Application.Forms.ActiveForm));
oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oRecordSet.DoQuery("SELECT ISNULL(MAX(CAST(Code AS Numeric)),0) as Code FROM [@V_CALLBACKS]");
string Code = Convert.ToString(oRecordSet.Fields.Item("Code").Value);
int Code1 = Convert.ToInt32(Code) + 1;
oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("Item_14").Specific; <------Error in this line.
oEditText.DataBind.SetBound(true, "@V_CALLBACKS", "U_Code");
oEditText.Value = Code1.ToString();
Can anyone help me to resolve this issue please.
Thanks
Varun.