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

Re: Update Child Table Data Using DIAPI

$
0
0

Hi Amit,

 

If yours is a UDO, use this :

        private void Test()        {            SAPbobsCOM.GeneralService oGeneralService = null;            SAPbobsCOM.GeneralData oGeneralData = null;            SAPbobsCOM.GeneralDataParams oGeneralParams = null;            SAPbobsCOM.CompanyService sCmp = null;            SAPbobsCOM.GeneralData oChild = null;            SAPbobsCOM.GeneralDataCollection oChildren = null;            sCmp = eCommon.oCompany.GetCompanyService();            try            {                oGeneralService = sCmp.GetGeneralService("UDOName");                // Get UDO record                oGeneralParams = ((SAPbobsCOM.GeneralDataParams)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));                oGeneralParams.SetProperty("DocEntry", DocEntryOfTheRecordToUpdate);                oGeneralData = oGeneralService.GetByParams(oGeneralParams);                // Add lines on UDO Child Table                oChildren = oGeneralData.Child("ChildTableNameWithout@");                // Create data for rows in the child table                oChild = oChildren.Add();                oChild.SetProperty("colUID", "TEST");                // Update an existing line                oChild = oChildren.Item(1);                oChild.SetProperty("colUID", "TEST");                //Update the UDO Record                oGeneralService.Update(oGeneralData);            }            catch (Exception ex)            {                SBO_Application.MessageBox(ex.Message, 1, "OK", null, null);            }        }

 

Regards
Edy


Viewing all articles
Browse latest Browse all 9236

Trending Articles



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