cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2028 and Error -1

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Anyone had solved this problem???

I have to find a solution quickly.

Please.

Best Regards!

Former Member
0 Kudos

Is ovDocOrd a datasource ?

If so, i would check that ovDocOrd is getting initialized properly and passed the proper values.

Former Member
0 Kudos

No ovDocOrd is the SBO Document, all Document informations passed properly

Former Member
0 Kudos

hmm ...

can you tell at which point in the code the message is provoked ? how about the recordset you are using! I can't tell from the code at which point you are loading it!

Former Member
0 Kudos

on this part

lerr = ovDocOrd.Update()

when i update the document the DI API generate the general error (error = -1) !!!!

if the sales order document have several lines the DI API will automatically generate this error

Former Member
0 Kudos

Well

I can't really see anything wrong. I would try to modify either ovDocOrd.Lines.BatchNumbers.BatchNumber = sBtchNbr or

ovDocOrd.Lines.BatchNumbers.Quantity = oTotCar first and if see if no error occurs just to try to determine if its whether with one field in specific the problem.