Skip to Content
0
Former Member
May 24, 2007 at 10:34 AM

Error -2028 and Error -1

9 Views

Hi,

when i update a sales orders documents with the batch numbers and batch quantity,sometimes i'm getting the following error <i>Error -2028</i> or the <i>Error - 1</i> !!!!! ?????

-


My Code -


-


Dim bIsFirstBatch As Boolean = True

While Not ovRS.EoF And Bol = True

If bIsFirstBatch = False Then

ovDocOrd.Lines.BatchNumbers.Add()

End If

iQte = CInt(ovRS.Fields.Item(3).Value)

iCommited = CInt(ovRS.Fields.Item(4).Value)

sBtchNbr = CStr(ovRS.Fields.Item(0).Value)

valAfect = iQte - iCommited

valRest = oTotCar - valAfect

If valRest > 0 Then

Try

ovDocOrd.Lines.BatchNumbers.BatchNumber = sBtchNbr

ovDocOrd.Lines.BatchNumbers.Quantity = valAfect

oTotCar = valRest

Catch ex As Exception

VBOEM10.ExceptionManager.Publish(ex)

End Try

Else

Try

ovDocOrd.Lines.BatchNumbers.BatchNumber = sBtchNbr

ovDocOrd.Lines.BatchNumbers.Quantity = oTotCar

Bol = False

Catch ex As Exception

VBOEM10.ExceptionManager.Publish(ex)

End Try

End If

ovRS.MoveNext()

bIsFirstBatch = False

End While

lerr = ovDocOrd.Update()

If lerr <> 0 Then

oCompany.GetLastError(lerr, cherr)

Throw New Exception(CStr(cherr))

End If