1 Reply Latest reply on Aug 20, 2014 8:53 AM by philmodjunk

    Active update of text field calculation OR order of tasks upon record commit

    BenOtto

      Title

      Active update of text field calculation OR order of tasks upon record commit

      Post

      Issue

           I'm using UltraLog (v1) to log my record changes. UltraLog typically logs any change upon commit of the record. My database should do two things: First, record changes made should be saved using UltraLog. Second, (after logging) these new changes should be copied into a global Audit Log Table.

      Current attempt (theory)

           In my layout I trigger a first script using OnRecordLoad. This script captures the current state of my record-specific audit log in a global variable $$oldlogstate.

           Upon saving the record, I trigger a second script using OnRecordCommit. This script reads the new state of the record-specific audit log, removes all entries already existent in $$oldlogstate and copies the new entries into my global Audit Log Table.

      Problem

      OnRecordCommit runs my second script even before UltraLog recognizes / saves any changes. In other words, the process is running in a wrong order.

      Question(s)

           1) Can I force my audit log field (text field calculated using UltraLog) to get updated via some script command? So I could include a step in my script that first updates my audit log before continuing with the copy processes?

           -> This is my important question. I need to solve that to get my process running.

            

           2) How does UltraLog (v1) know when (on record commit) to get activated? I can't recognize a specific command in the function itself. Comparing it with SuperLog (which logs upon field change) the behavior seems not to be controlled via field options. So how does SuperLog know that it has to log upon field change and UltraLog that it has to log upon record commit?

           -> This is more a question of understanding what happens under the hood. :)

            

           cheers

            

           Ben