Skip to Content

How to work with SAP B1 buttons in SDK?

Hi all,

I tried to take event from menu buttons successfully like this

    Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
        If SBO_Application.Forms.ActiveForm.TypeEx.Equals("1250000100") Then
            If pVal.BeforeAction = True Then
                SBO_Application.MessageBox("Button pressed " & vbNewLine & "Hello World!")
            End If
        End If

How can I take event from form buttons like Add and Update of the system form (A/R Invoice)?

This means, If I click Add or Update button and execute my addition codes

Please anyone can help me

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 18, 2017 at 11:09 AM

    Hi,

    You can use either Item Event for your purpose or can use Data Event:

    Data Event:

    SBO_Application.FormDataEvent += new SAPbouiCOM._IApplicationEvents_FormDataEventEventHandler(Handle_SBO_DataEvent);
    
    public override void Handle_SBO_DataEvent(ref BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent)
    {
        BubbleEvent = true;
        if (BusinessObjectInfo.BeforeAction == false && BusinessObjectInfo.EventType == BoEventTypes.et_FORM_DATA_UPDATE && BusinessObjectInfo.FormTypeEx == "134")
        {
            // Write your logic here.
        }
    }

    Item Event:

    if (pVal.FormType == 141 && pVal.ActionSuccess == true && pVal.EventType == BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == "1" && pVal.FormMode == 3)
     {
        // Write your logic here.
     }

    There might have been too many threads on this type of issue. Please search it. Also refer to SDK Help Center for the same.

    Hope it helps!

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded