Hi Steve,
Is this a user form or a system form ?
Dim oProductionOrder As SAPbobsCOM.ProductionOrders
oProductionOrder = CType(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders), SAPbobsCOM.ProductionOrders)
oProductionOrder.GetByKey(ooProductionOrderDocEntry)
If Not IsError2 Then 'OpprId
oProductionOrder.UserFields.Fields.Item("U_INFO").Value = "C"
lRetCode = oProductionOrder.Update()
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MessageBox.Show(sErrMsg)
End If
Please add the underlined code.
What is IsError2 ?
Also what is IsError ?
oRec2.DoQuery("UPDATE [@PROD_ORDER] set Code = 'C' where DocEntry = '" + oProductionOrderDocEntry + "'")
The Code field in UserTable is a unique field.
You may not have duplicate value of C across all records in the table.
Regards
Edy