Hi all,
I have a problem in SDK codes,
I opened project in C:\Program Files\SAP\SAP Business One SDK\Samples\UDO\addUDO\VB.NET then I added new textbox3 in order to understand well how SDK codes work.
If I use use TextBox3.Text I can add data to database as shown bellow
Try oCompanyService = oCompany.GetCompanyService 'Get GeneralService (oCmpSrv is the CompanyService) oGeneralService = oCompanyService.GetGeneralService("SM_MOR") 'Create data for new row in main UDO oGeneralData = oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData) oGeneralData.SetProperty("U_Price", TextBox3.Text)
But if I declare variable and assign value of TextBox3 to that the variable I cannot add data to the database, the following error message is displayed Illegal value entered
Dim TestNumber1 As Integer Try TestNumber1 = Val(TextBox3.Text) oCompanyService = oCompany.GetCompanyService 'Get GeneralService (oCmpSrv is the CompanyService) oGeneralService = oCompanyService.GetGeneralService("SM_MOR") 'Create data for new row in main UDO oGeneralData = oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData) oGeneralData.SetProperty("U_Price", TestNumber1)
Please anyone can help me.