cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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;
	}
}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use et_ITEM_PRESSED event rather than the click event.

Indika

Former Member
0 Kudos

Thanks for that - I always thought the ITEM_PRESSED event was fired after the record was saved but looks like I was wrong.

Thanks for your help!

Answers (0)