Skip to Content
0
Former Member
Aug 03, 2005 at 04:03 PM

UI: Delivery Screen - Message box shown in button click event cancels add

13 Views

I've added a message box to the delivery screen, so that when the user clicks add they get the option of saving the delivery as a draft or as a delivery.

The code to save the delivery in draft mode works fine - I just call the activate menu item. However, if I want the delivery to be saved (in otherwords, I just want the delivery screen to carry on as normal) then SBO seems to cancel the event and not save anything.

Here's the code (from the ItemEvent event):

if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK && pVal.ItemUID == "1" && pVal.BeforeAction)
{
	if (pVal.FormMode == (int)SAPbouiCOM.BoFormMode.fm_ADD_MODE)
	{
		if (moSBOApp.MessageBox("Save as draft?", 1, "Yes", "No", "") == 1)
		{
			// save as draft
			moSBOApp.ActivateMenuItem("5907");
			BubbleEvent = false;
		}
		else
		{
			BubbleEvent = true;
		}
	}
	else
	{
		BubbleEvent = true;
	}
}