on 05-04-2013 1:01 PM
Dear Friends,
I want to update one UDO (which is having header and child table). In existing document entry I want to update some existing Line Item rows and want to add some new rows in child table. Can you please provide me some sample code for this.
Thanks
Nitish Mishra
Hi Nitish,
You can find the sample below in the SDK Help Center. Look for GeneralService Object for more info.
Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oChild As SAPbobsCOM.GeneralData
Dim oChildren As SAPbobsCOM.GeneralDataCollection
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams
'Get GeneralService (oCmpSrv is the CompanyService)
Set oGeneralService = oCmpSrv.GetGeneralService("MainUDO")
'Create data for new row in main UDO
Set oGeneralData = oGeneralService.GetDataInterface(gsGeneralData)
oGeneralData.SetProperty "Code", "First"
oGeneralData.SetProperty "U_Data", "my data"
'Create data for a row in the child table
Set oChildren = oGeneralData.Child("ChildUDO")
Set oChild = oChildren.Add
oChild.SetProperty "U_Data", "child data"
oChild.SetProperty "U_Type", 6
'Add the new row, including children, to database
oGeneralService.Add oGeneralData
Good luck.
Best regards,
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.