📚 SAP Business One SDK Help

GetByKey Method
See Also 
ItemCode

The key of the item whose discounts are to be retrieved. This is a foreign key to the Items object.

CardCode

The key of the business partner whose discounts are to be retrieved. This is a foreign key to the BusinessPartners object.

Specifies the identification key of the business object (CardCode).

Description

Retrieves and sets the values of the object's properties by the object's absolute key from the Company database.

Syntax

Visual Basic
Public Function GetByKey( _
   ByVal ItemCode As String, _
   ByVal CardCode As String _
) As Boolean

Parameters

ItemCode

The key of the item whose discounts are to be retrieved. This is a foreign key to the Items object.

CardCode

The key of the business partner whose discounts are to be retrieved. This is a foreign key to the BusinessPartners object.

Specifies the identification key of the business object (CardCode).

Return Type

If the object with the key you specified is found, the method returns True and the properties of the object will be filled with object's data.

If the object with the key you specified is not found, the method returns False and the properties of the object remain unchanged.

Remarks

To use this method you must specify the object key.

You can also use this method to find whether or not there is an object related to the key you specify.

If you do not know the object key, you can use the DataBrowser object to retreive an object using more complex queries.

See Also