on 03-09-2017 11:56 AM - last edited on 02-03-2024 10:31 PM by postmig_api_4
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
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.