Adds a record to the object table in SAP Business One company database.
| Visual Basic |
|---|
Public Function Add() As Long |
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.
The following sample shows how to add an invoice (with lines) document to the database. Use this sample as a basis for all business objects of document type (not master data type).
| Invoice Document - Add Method Sample (Visual Basic) | Copy Code | |
|---|---|---|
| ||