Skip to Content
avatar image
Former Member

UDO childs

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers