📚 SAP Business One SDK Help

Form Object
See Also  Members  Example

Description

Represents a form in the SAP Business One application.

The form is identified by its unique ID, but only for the lifecycle of the form. 

Object Model








Example

Adding forms and items, binding items to data (Visual Basic)Copy Code
Public Sub CreateSimpleForm()

    Dim oForm As SAPbouiCOM.Form
    Dim oItem As SAPbouiCOM.Item

    Dim oButton As SAPbouiCOM.Button

    '// add a new form
    Set oForm = SBO_Application.Forms.Add("SimpleForm", ft_Fixed)

    '// set the form properties
    oForm.Title = "Simple Form"
    oForm.Left = 400
    oForm.Width = 300
    oForm.Top = 100
    oForm.Height = 100

    '//*****************************************
    '// Adding Items to the form
    '// and setting their properties
    '//*****************************************

    '/**********************
    '// Adding an Ok button
    '//*********************

    '// We get automatic event handling for
    '// the Ok and Cancel Buttons by setting
    '// their UIDs to 1 and 2 respectively

    Set oItem = oForm.Items.Add("1", it_BUTTON)
    oItem.Left = 5
    oItem.Width = 65
    oItem.Top = 50
    oItem.Height = 19

    Set oButton = oItem.Specific

    oButton.Caption = "Ok"

    '//************************
    '// Adding a Cancel button
    '//***********************

    Set oItem = oForm.Items.Add("2", it_BUTTON)
    oItem.Left = 75
    oItem.Width = 65
    oItem.Top = 50
    oItem.Height = 19

    Set oButton = oItem.Specific

    oButton.Caption = "Cancel"

End Sub






See Also