Open Forum

 View Only
  • 1.  Screen refresh after trigger fires on save

    TOP CONTRIBUTOR
    Posted Jul 08, 2021 03:57 PM
    For various reasons, we need to use a trigger to update a field in the GLTran table on an insert or update of a GL Journal Entry.

    The trigger is working fine, but the problem is that a trigger does not display until the screen is "refreshed" .   For example, after a save, hit "Esc" and answering "No" to message.    At that point, the updated field displays correctly.

    Does anyone know if there is an easy way to force a screen refresh after a save in a customization?

    A code example would be greatly appreciated!

    ------------------------------
    Gail Jones-Nemeth
    Financial Systems Analyst
    Creative Associates Int'l
    Chevy Chase MD
    ------------------------------


  • 2.  RE: Screen refresh after trigger fires on save

    TOP CONTRIBUTOR
    Posted Jul 08, 2021 05:35 PM
    Try this:
    Private Sub Update1_OnUpdate(ByVal Level As Integer, ByVal InsertFlg As Integer, retval As Integer)
      If Level = 0 Then serr1 = CallChks("Form1", "cbatnbrH")
    End Sub​

    That should refresh the screen, including the grid, whenever a change is saved.



    ------------------------------
    Jonathan Van Houtte
    Architect
    XLstatements, LLC
    Clifton Park NY
    ------------------------------



  • 3.  RE: Screen refresh after trigger fires on save

    SILVER CONTRIBUTOR
    Posted Jul 09, 2021 12:56 AM
    There is s level 'Finished' that will fire after the data has been committed to the database and before control is returned to the User Interface.  
    The numeric level is 32000, but there is a constant of 'Finished' for this purpose

    Using Jonathan's example:

    If level = Finished then 

        serr1 = CallChks("Form1", "cbatnbrH")
    End Sub​

    Doing it on this level will allow for the trigger to file before the data is reloaded to the screen



    ------------------------------
    Mark Schrier
    Information Systems Director
    Mackay Communications, Inc
    Raleigh NC
    ------------------------------



  • 4.  RE: Screen refresh after trigger fires on save

    SILVER CONTRIBUTOR
    Posted Jul 12, 2021 08:37 AM
    Corrected code

    If level = Finished then 

        serr1 = CallChks("Form1", "cbatnbrH")
    End If


    ------------------------------
    Mark Schrier
    Information Systems Director
    Mackay Communications, Inc
    Raleigh NC
    ------------------------------



  • 5.  RE: Screen refresh after trigger fires on save

    TOP CONTRIBUTOR
    Posted Jul 12, 2021 01:44 PM
    Yes!!  Thank you Jonathan and Mark.    It worked!

    I am now getting the trigger and screen display to work together.    My customization is now refreshing the screen after the trigger runs and properly displaying my updated field.

    Yay!!!


    ------------------------------
    Gail Jones-Nemeth
    Financial Systems Analyst
    Creative Associates Int'l
    Chevy Chase MD
    ------------------------------



  • 6.  RE: Screen refresh after trigger fires on save

    GOLD CONTRIBUTOR
    Posted Jul 20, 2021 07:36 PM

    Thanks for sharing Mark and Jonathan - I had a similar situation and I was manually updating the field again to display the new value - this works nicely and cuts out that need.

    Thanks,
    Marc



    ------------------------------
    Marc DeLozier
    Finance SysAdmin
    David Evans and Associates Inc.
    Portland OR
    ------------------------------



  • 7.  RE: Screen refresh after trigger fires on save

    TOP CONTRIBUTOR
    Posted Aug 05, 2021 08:15 AM
      |   view attached
    Just a quick follow-up, we ran into an issue in the GL Journal Entry screen (01.010) where I couldn't change the batch status with the original code.   Mark very kindly did a Zoom session with me to enhance the code for that screen and I've now attached it to this thread.

    We now had a couple of weeks with the trigger running against GLTran and APTran, and the screen refresh code works exactly as we needed it to.

    Best regards,

    ------------------------------
    Gail Jones-Nemeth
    Financial Systems Analyst
    Creative Associates Int'l
    Chevy Chase MD
    ------------------------------