📚 SAP Business One SDK Help

GetForm Method
See Also  Example
Type
The type of the form to return
Count
The instance of the specified form type (1-based)

Description

Returns a form within the application based on its type and type instance.

Syntax

Visual Basic
Public Function GetForm( _
   ByVal Type As String, _
   ByVal Count As Long _
) As Form

Parameters

Type
The type of the form to return
Count
The instance of the specified form type (1-based)

Remarks

Each SAP Business One form has a type, which is a unique ID for the form. For example, the type of the Purchase Order form is 142.

Each form can be open multiple times, and the application keeps a counter for each form type of the number of open instances. To get the number of forms open of the same type, use Form.TypeCount. Form objects pointing to different instances of the same type form have the same value in the TypeCount field.

To access a specific instance of a specific form type, use the Forms.GetForm method.

Example

Getting a form (Visual Basic)Copy Code
'Get the i (1-based) form of type MY_FORM_TYPE
Dim oForm As SAPbouiCOM.Form
Set oForm = oApplication.Forms.GetForm(MY_FORM_TYPE, i)

See Also