Description
The following example shows how to add an Items object to SAP Business One database.
Sub Add_Item()
    Dim RetVal As Long
    Dim ErrCode As Long
    Dim ErrMsg As String
    Dim vItem As SAPbobsCOM.Items
    Set vItem = vCmp.GetBusinessObject(oItems)
   Â
    vItem.ItemCode = "MyNewItem"
   Â
    vItem.ItemName = "MyNewItem Name"
    vItem.WhsInfo.WarehouseCode = "01"
   Â
    RetVal = vItem.Add
   Â
    If RetVal <> 0 Then
        vCmp.GetLastError ErrCode, ErrMsg
        MsgBox ErrCode & " " & ErrMsg
    End If
 End Sub |