cancel
Showing results for 
Search instead for 
Did you mean: 

UDO childs

Former Member
0 Kudos

Hi!

I have an UDO object and I want to update its lines from another object. I have this code:

Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams
Dim oChild As SAPbobsCOM.GeneralData
Dim oChildren As SAPbobsCOM.GeneralDataCollection

oGeneralParams = oGeneralService.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralDataParams)
oGeneralParams.SetProperty("DocEntry", obj.DocEntry)
oGeneralData = oGeneralService.GetByParams(oGeneralParams)

For Each line In obj.Lines
  oChildren = oGeneralData.Child("tableChild")
  'Search child
  If exists Then 'if child exists, I want to update it
    oChild.SetProperty("Field","Value")
  Else 'if child don't exists, I want to add it
    oChild=oChildren.Add
    oChild.SetProperty("Field","Value")
  End If
Next

oGeneralService.Update(oGeneralData)

Someone can help me to search if child exists or not, and if it exists how to get the index?

Thanks

Accepted Solutions (0)

Answers (0)