📚 SAP Business One SDK Help

LayoutKeyEvent Event
See Also  Example
eventInfo
The object that holds the event information
BubbleEvent

Indicates how the application handles the event. Relevant only when LayoutKeyInfo.BeforeAction is true.

  • True: The application handles the event after the current event handler is finished (default).
  • False: The application does not handle the event.
  • Description

    Occurs when you print or print preview a layout of an add-on form.

    When the layout needs the key of the add-on form, the add-on catches and sets LayoutKeyInfo.LayoutKey to the key.

    Syntax

    Visual Basic
    Public Event LayoutKeyEvent( _
       ByVal eventInfo As LayoutKeyInfo, _
       ByRef BubbleEvent As Boolean _
    )

    Parameters

    eventInfo
    The object that holds the event information
    BubbleEvent

    Indicates how the application handles the event. Relevant only when LayoutKeyInfo.BeforeAction is true.

  • True: The application handles the event after the current event handler is finished (default).
  • False: The application does not handle the event.
  • Example

    Catching the layout key events (C#)Copy Code
    //Add Layout Key Event Handler 
    SBO_Application.LayoutKeyEvent += new SAPbouiCOM._IApplicationEvents_LayoutKeyEventEventHandler(SBO_Application_LayoutKeyEvent); 
     
    void SBO_Application_LayoutKeyEvent(ref SAPbouiCOM.LayoutKeyInfo eventInfo, out bool BubbleEvent) 

        BubbleEvent = true; 
     
        if (eventInfo.ReportTemplate == "A001" && eventInfo.ReportCode == "A001001") 
        { 
            eventInfo.LayoutKey = 1; //Set the key of the layout 
        } 

    See Also