Closes a record of the object in SAP Business One database.
Public Function Close() As Long
Sub CloseDocument() Dim RetVal As Long Dim ErrCode As Long Dim ErrMsg As String Dim vOrder As SAPbobsCOM.Documents Set vOrder = vCmp.GetBusinessObject(oOrders) 'Retrieve the document record to close from the database RetVal = vOrder.GetByKey("55") If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg Exit Sub End If 'Close the record RetVal = vOrder.Close If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Close the record " & ErrCode & " " & ErrMsg End If End Sub
SalesOpportunities Object