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

Re: How to validate an update into a UDO using GeneralService?

$
0
0

Hi Christian,

can you show some code.

Because when I try to enter wrong data in a field ( SetProperty ) it throws an exception in that very line and I don't get to update .

 

SAPbobsCOM.GeneralService oGeneralService = null;
SAPbobsCOM.GeneralData UDOData = null;
SAPbobsCOM.GeneralDataParams UDOParameter = null;
oGeneralService = (SAPbobsCOM.GeneralService)Program.SBO_Company.GetCompanyService().GetGeneralService("UDONAME");
UDOData = (SAPbobsCOM.GeneralData)oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData);
UDOParameter = (SAPbobsCOM.GeneralDataParams)oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams);
UDOParameter.SetProperty("Code", "1");
UDOData = oGeneralService.GetByParams(UDOParameter);
UDOData.SetProperty("U_ALPHA", "ABCD");
oGeneralService.Update(UDOData);

In this case U_ALPHA is an alphanumeric field, size 3. Exception is thrown in this line ( 9 ). I verified with all kind of fieldtypes.

 

regards,

Maik


Viewing all articles
Browse latest Browse all 8451

Trending Articles



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