cancel
Showing results for 
Search instead for 
Did you mean: 

delete data prompts the user Yes/No?

Former Member
0 Kudos

I would like to delete data prompts the user Yes/No?

When click "Yes" confirm delete, click "No" cancel delete.

What to do?

Please provide code?

Thanks very much!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I want use the System Menu to delete the data to prompt the user.

I should add it in which SBO_Application event?

"ItemEvent or AppEvent or FormDataEvent or MenuEvent"

Thanks!!!

Former Member
0 Kudos

Hi Youbing You

You need to post code to call Confirm(...) in the ItemEvent


Public Sub ManageItemEvent( _
      ByVal FormUID As String, _
      ByRef pVal As SAPbouiCOM.ItemEvent, _
      ByRef BubbleEvent As Boolean _
) Handles SBO_Application.ItemEvent

  Dim oForm As SAPbouiCOM.Form
  oForm = SBO_Application.Forms.Item(FormUID)

  Select Case pVal.EventType
    Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
      Select Case pVal.ItemUID
	Case "1"  ' Ok, Confirm operation
	  If Not pVal.BeforeAction Then
	      BubbleEvent = Confirm(...)
	  End If
      End Select
  End Select

End Sub

Regards

Sierdna S.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Use this



If Confirm("DO you want do do this operation ?") Then
  ' Do it
Else
  ' Don'not do it
End If
...
Private Function Confirm(ByVal sMessage As String) As Boolean
    On Error Resume Next
    Confirm = False
    Dim i As Integer
    i = SBO_Application.MessageBox(sMessage, 2, "Yes", "No")
    Select Case i
	Case 1 ' Yes
	    Confirm = True
	Case 2 ' No
	    Confirm = False
    End Select
    On Error GoTo 0
End Function

Regards

Sierdna S.

Former Member
0 Kudos

Hi,

It was a system message.

You can catch it like this :

if (pVal.FormType == 0 && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)

{

SAPbouiCOM.Item oItem;

SAPbouiCOM.Button oButton;

oForm = SBO_Application.Forms.Item(pVal.FormUID);

oItem = oForm.Items.Item("1");

oButton = (SAPbouiCOM.Button)oItem.Specific;

oItem.Click(SAPbouiCOM.BoCellClickType.ct_Regular);

}

Hope it's help you

Regards

Michael