Skip to Content
0
Jul 21, 2020 at 04:39 AM

SAPbouiCOM.Framework.Application.SBO_Application.MessageBox cancelling sap event

399 Views Last edit Jul 21, 2020 at 04:40 AM 2 rev

HI,

We are trying to prompt a message box and if user press cancel, we cancel the adding of SAP document. We have added the AddButton_ClickBefore handler. The prompt appears as expected, but setting bubbleevent to true doesnt make the SAP continue processing.

We have noticed that, if the message box is shown then SAP is not continuing its process any more. if no messagebox, it works.

            this.AddButton.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.AddButton_ClickBefore);



 private void AddButton_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
                if (2 == SAPbouiCOM.Framework.Application.SBO_Application.MessageBox("msg", DefaultBtn: 1, Btn1Caption: "ok", Btn2Caption: "cancel"))
                            {
                                BubbleEvent = false;
                                  
                                }                              
        }