Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8122

Bind data to UDF

$
0
0

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.


Viewing all articles
Browse latest Browse all 8122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>