📚 SAP Business One SDK Help

GetNew ObjectCode Method
See Also 
ObjectCode
Gets the key of the last object that you have created.

Description

Retrieves the key of the last added record.

Syntax

Visual Basic
Public Sub GetNewObjectCode( _
   ByRef ObjectCode As String _
) 

Parameters

ObjectCode
Gets the key of the last object that you have created.

Remarks

After you create a new object such as, BusinessPartners and Items objects, you can use this method to retrieve the object key. If no new object is found, the method returns an empty string in the ObjectCode parameter.

You can use this method, for example, to create a payment based on an invoice:

  1. Create invoice.
  2. Get the key for identifying the invoice (Invoices property of the Payments object).
  3. Create the payment.

See Also