Skip to Content
0
Former Member
Jan 10, 2008 at 01:19 AM

Error Code -5002 when updating Sales Quotation

23 Views

Our Sales Quotation documents have 3 UDF: Contract Status, Approver1, Approver2.

when a user updates the Sales Quotation in SAP, our addon resets these fields by DI to 'Pending', "", "" , so the document needs to be approved again.

Here is the code called in AfterDataFormUpdate:

Me.oDoc.UserFields.Fields.Item("U_XX_Ap1U").Value = ""

Me.oDoc.UserFields.Fields.Item("U_XX_Ap2U").Value = ""

Me.oDoc.UserFields.Fields.Item("U_XX_ConSta").Value = "P"

fncRetVal.retCode = Me.oDoc.Update()

If fncRetVal.retCode <> AddonVars.enumReturnCodes.Success Then

oDiCompany.GetLastError(lErrCode, sErrMsg)

End If

I'm getting a retCode = -5002, and ErrMsg = "Cannot insert value in the 'Folio Number' field "

Has anyone seen this before? Any input is appreciated.

thanks,

Grace