3 Replies Latest reply on Aug 15, 2014 3:09 PM by philmodjunk

    Keeping multiple updates in one field.



      Keeping multiple updates in one field.


           I am creating an alumni database and i am wanting to create a field where i can keep track of who makes updates to the alumni record. I want the field to record who makes corrections from the very beginning during data entry and retain that information as other people continue to update the record over the years. Does anyone have any ideas on how best to achieve this. I am using Filemaker Pro 11.

        • 1. Re: Keeping multiple updates in one field.

               Well I wouldn't use a single field for that. I'd set up a related table and a portal so that each time changes are made to the field, you add a record to this related table in order to document those changes.

               Do you want this logging of changes to be automatic via some scripts or do you want the users to make entries to log the changes that they are making to the data in the record?

               Both are possible, but it can take a lot of scripting with script triggers to log all the changes automatically. (And there might be a plug in out there that makes this easier to do...)

          • 2. Re: Keeping multiple updates in one field.

                 I would like the changes to be automatic but either way is fine. I just want to be able to track when someone makes changes to a record.

            • 3. Re: Keeping multiple updates in one field.

                   There are several ready made solutions "out there" produced by other developers that capture all changes made to a record and log them. I think I recall one that uses a plug in to do this. You might want to do a bit of websearching on this topic.

                   What I've gotten to work is to use script triggers on every field.

                   So if you have a field named "YourTable::Date" on your layout, you'd set up the onObjectEnter Trigger with  a script parameter of: YourTable::Date. The script would be:

                   Set Variable [$$OldValue ; Get ( ScriptParameter ) ]

                   Then your OnObjectSave trigger on the same field would be:

                   IF [ Get ( ActiveFieldContents ) ≠ $$OldValue // field has been changed ]
                      Put script steps here to create a new record and set a field in it to the value of $$OldValue and another field to the name of the current field.
                   End IF

                   With careful scripting you need only create and use the same two scripts and script triggers with every field on your layout.