Description
Closes a record of the object in SAP Business One database.
Syntax
| Visual Basic |
|---|
Public Function Close() As Long |
Example
The following sample shows how to close a document record. Use this sample as a basis to all business objects of document type (not master data type).
| Order Document - Close Method Sample (Visual Basic) | Copy Code |
|---|
Sub CloseDocument()
    Dim RetVal As Long
    Dim ErrCode As Long
    Dim ErrMsg As String
    Dim vOrder As SAPbobsCOM.Documents
    Set vOrder = vCmp.GetBusinessObject(oOrders)
   Â
    RetVal = vOrder.GetByKey("55")
    If RetVal <> 0 Then
        vCmp.GetLastError ErrCode, ErrMsg
        MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg
            Exit Sub
    End If
   Â
    RetVal = vOrder.Close
    If RetVal <> 0 Then
        vCmp.GetLastError ErrCode, ErrMsg
        MsgBox "Failed to Close the record " & ErrCode & " " & ErrMsg
    End If
End Sub |
|
See Also