Skip to Content
avatar image
Former Member

How to Track System Message Event

Hi,

I created Form using Screen Painter. I want to make some validation on Form closing event.

How to Track for SAP system message (Do you want save changes? YES, No, Cancel) YES part. and i want to make some validation on that event.

Is it possible?

Regards,

Ganesh k

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 02, 2008 at 02:38 AM

    Dear Ganesh Karunakaran,

    Please try solution as follwing sample code:

    Private Sub SBO_Application_ItemEvent (.....
    
    Dim res As Integer
    
            Select Case pVal.EventType
                    
                    ......
    
                Case et_FORM_CLOSE:
                
                '// terminate the add on application
                res = SBO_Application.MessageBox("test", 2, "OK", "Cancel")
                
                If res = 1 Then
                '//ok
                
                ElseIf res = 2 Then
                '//cancel
                
                End If
                
                
                    End
            End Select
        End If
        
    End Sub
    

    Best Regards

    Jane Jing

    SAP Business One Forums team

    Edited by: Jane Jing on Sep 2, 2008 4:40 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 10:37 AM

    Hi

    We can Trace sql server profiler.

    Regards.,

    billa 2007

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 10:39 AM

    You can trap the system form (i think that the formtype is blank), but you cannot find out, if the user selected Yes or No.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 01, 2008 at 11:50 AM

    Dim d As Integer = objMain.objApplication.MessageBox("Your message.", 1, "OK", "Cancel", "")

    If (d = 1) Then

    your code

    else

    exit

    regards:

    SANDY

    Edited by: | Sandeep Saini | Roorkee | India on Sep 1, 2008 5:21 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 12:14 PM

    U can download a software "SAP Business One Event Logger" from this website.After installing u can get detailed information of every event.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 12:25 PM

    Hi Ganesh,

    You can catch the system message 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

    Add comment
    10|10000 characters needed characters exceeded