1 Reply Latest reply on Nov 15, 2012 9:18 AM by philmodjunk

    How do I create a 'track changes' identifier script?

    AlexaPetrelli

      Title

      How do I create a 'track changes' identifier script?

      Post

           Hi, 

            

           I'm new to file maker Pro, and by extension FileMaker Go.

            

           Does anyone have a suggestion on how to create a script that will identify a change in a field?  Preferably, if I make a change, I would like it to make the text red on both the file and the list.  We have many records, and while a timedate stamp indicated that I did something to a record (or verified that it was correct), it would be much easier to highlight what exactly changed when the data is scrubbed.

            

           Thanks.

        • 1. Re: How do I create a 'track changes' identifier script?
          philmodjunk

               It's not a simple thing to set up and takes a fair amount of expertise with scripting, script triggers, relationships, etc.

               There are two basic approaches that you can take:

               Put an "edit" button on your layout. Clicking it duplicates the current record and changes to a layout where editig is permitted. You then identify fields that have changed data by comparing fields in the new copy of the record to the previous copy via a relationship. This generates a lot of nearly duplicate records in your table so this solves one problem but can complicate others. To make it work, you have to be able to "flag" the most recent version of the record and use scripts, finds, portal filters to hide the older copies of the record from view or you export those copies to a different table.

               Use script triggers that capture the current value of a field in a global variable when you enter the field. Use an "onObjectSave" trigger to then update yet another global variable with the previous value of the field and the name of the field. Use an OnCommitRecords trigger to then save this data into fields of a "Change Log" table where you log the primary key of the record that was changed, what fields were changed and their previous values.