Hi,
There is an UDO I created that haves line items. Below is how the data looks in SAP

Below is how the data appearing in SQL

Based on the above query, I’m trying to update LindId 10 and 11. I know for the SDK when you update line items, you subtract by one. So, for this example in the SDK, the line items would be 9 and 10. When I try to update these two rows with these line numbers, I get Invalid row error. This issue started to happen after when I deleted row items. I’m trying to figure out why I’m facing this issue despite I see these line numbers in the database as for the screenshots I’m showing you above?
Edit:
Below is some of the code I'm using that handles the update
Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oChildren As SAPbobsCOM.GeneralDataCollection
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams
Dim sCmp As SAPbobsCOM.CompanyService
Dim rows As Integer = oMatrix.RowCount - 1
sCmp = oCompany.GetCompanyService
oGeneralService = sCmp.GetGeneralService("SPA")
oGeneralParams = oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)
oGeneralParams.SetProperty("DocEntry", "5")
oGeneralData = oGeneralService.GetByParams(oGeneralParams)
oChildren = oGeneralData.Child("SPA_L")
For row As Integer = 1 To rows
lineNum = CInt(oMatrix.Columns.Item("LineId").Cells.Item(row).Specific.Value()) - 1
docNum = CInt(oMatrix.Columns.Item("DocNum").Cells.Item(row).Specific.Value())
cardCode = oMatrix.Columns.Item("CardCode").Cells.Item(row).Specific.Value()
cardName = oMatrix.Columns.Item("CardName").Cells.Item(row).Specific.Value()
oChildren.Item(lineNum).SetProperty("U_DocNum", docNum)
oChildren.Item(lineNum).SetProperty("U_CardCode", cardCode)
oChildren.Item(lineNum).SetProperty("U_CardName", cardName)
Next
oGeneralService.Update(oGeneralData)