B4J Tutorial [ABMaterial] TIP: ... and wait for

Discussion in 'B4J Tutorials' started by alwaysbusy, Nov 30, 2018.

  1. alwaysbusy

    alwaysbusy Expert Licensed User

    Maybe this is old news, but I was wondering if wait for could work with ABM events, and it seems they do!

    Here for example (it is a page_ event, so I put it in the same class as where the page is defined), I ask the user with a message box if he is sure to do the delete. If yes, then do the queries.

    Code:
    Sub CheckDoDelete(TableActiveID As Int)
       
    Dim Code As String = "REGISTRATION_DELETE"
       
    Dim authLoginID As String = page.ws.Session.GetAttribute2("authLoginID2020""")
       
    Dim sysrlID As Int = DBMApp.InsertLog(authCurrentMasterID, TableActiveID, Code, authLoginID)
      
       
    page.Msgbox2("FLOW""Ben je zeker?""""ja""nee"False, ABM.MSGBOX_TYPE_NOICON, False, ABM.MSGBOX_POS_CENTER_CENTER, "onetwo")
       
    Wait For Page_MsgboxResult(returnName As String, result As String)
       
    If result = ABM.MSGBOX_RESULT_OK Then
           
    Dim reg As RecRegistration = DBMApp.RegistrationFromRecord(TableActiveID,BrowserTZ)
          
           
    Dim SQL As SQL = DBM.GetSQL
           
    Try
               
    SQL.BeginTransaction          
               
    Select Case reg.regRegTypID
                   
    Case 16
                       DBMApp.UPDATESTATUSRegistration(
    SQL, TableActiveID, 18Null, authLoginID, Code,sysrlID)
                   
    Case 19
                       DBMApp.UPDATESTATUSRegistration(
    SQL, TableActiveID, 21Null, authLoginID, Code,sysrlID)
                   
    Case 26
                       DBMApp.UPDATESTATUSRegistration(
    SQL, TableActiveID, 28Null, authLoginID, Code, sysrlID)
               
    End Select          
               
    SQL.TransactionSuccessful
              
               Table2.DoDelete
           
    Catch
               
    SQL.Rollback
           
    End Try      
           DBM.CloseSQL(
    SQL)
       
    End If
    End Sub
    Alain
     
    Last edited: Dec 2, 2018
    jinyistudio, amaxco, Anser and 6 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice