📚 SAP Business One SDK Help

Create Object Method
See Also  Example
Type
The type of object to create

Description

Creates an object of the specified type.

Use this method to create forms, menus, or conditions for DBDataSource.Query.

Syntax

Visual Basic
Public Function CreateObject( _
   ByVal Type As BoCreatableObjectType _
) As Object

Parameters

Type
ValueDescription
cot_MenuCreationParamsMenuCreationParams object
cot_FormCreationParamsFormCreationParams object
cot_ConditionsConditions object
cot_ChooseFromListCreationParamsChooseFromList object
cot_WidgetRegParamsWidgetRegParams object
cot_WidgetCategoryRegParamsWidgetCategoryRegParams object
The type of object to create

Remarks

This method is the recommended way to create new objects. See the example below for creating a new form.

Creating new objects using the New statement should be avoided and is supported in the current release for compatibility reasons only.

Example

Creating a new form (Visual Basic)Copy Code
Private Sub CreateMyForm()
   Dim oCreationParams As SAPbouiCOM.FormCreationParams
   oCreationParams = SBO_Application.CreateObject (SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
   oCreationParams.UniqueID = "MyForm"
   oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
   oForm = SBO_Application.Forms.AddEx(oCreationParams)
End Sub

See Also