API Stock Transfer / Add
Add Method


Adds a record to the object table in SAP Business One company database.


Visual Basic
Public Function Add() As Long

Return Type

Returns a result value that indicates success or failure. If the method succeeds, it returns 0. Otherwise, it returns an error code.

You can retrieve the last error code and its description using the method GetLastError.


You must values for the mandatory properties, and then call the Add method. The auto-complete feature completes all the default values of the other properties. In the DI API, the auto-complete feature operates the same way as in the SAP Business One application.


Adding a draft stock transfer (Visual Basic)
' Add a draft of stock transfer Dim draft As SAPbobsCOM.IStockTransfer draft = oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft) ' Draft details draft.CardCode = "Code1" draft.Add()
Converting draft stock transfer to stock transfer (Visual Basic)
Dim draft As SAPbobsCOM.IStockTransfer 'Convert a draft of stock transfer to a stock transfer draft = oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft) draft.GetByKey(1) draft.SaveToFile("C:\Draft.xml") '********** Manual Action Required: Modify the ObjectCode from 1179 to 65 in "C:\Draft.xml" Dim oStockTransfer As SAPbobsCOM.StockTransfer oStockTransfer = oCompany.GetBusinessObject(BoObjectTypes.oStockTransfer) oStockTransfer.Browser.ReadXml("C:\Draft.xml", 0) oStockTransfer.Add()


See Also

SAP® Business One is the trademark(s) or registered trademark(s) of SAP AG in Germany and in several other countries. Contact
This website is not affiliated with, maintained, authorized, endorsed or sponsored by SAP AG or any of its affiliates