10 Replies Latest reply on Apr 1, 2017 4:25 AM by fmpdude

    Logging Modifications


      A client wants to have a revision log for their Invoice.  The ability to know details abut changes.  When it changed, who changed it, and what the change was.  This log would be store infinite modifications.


      I have set this up in limited cases were I have a script trigger to store the field content on entry and upon object change post all the information to a Revision log.   For example salary changes, or project name changes.


      But I have never done it for an entire Form.  Over 100 fields. 


      Curious if anyone has solution to share (or sell).

        • 1. Re: Logging Modifications

          If an invoice has over 100 fields, something is very wrong with that design unless you have some very unusual invoicing needs.


          But a number of third party developers offer audit trail tools that you might take a look at.

          • 3. Re: Logging Modifications

            My systems are highly specialized for the Motion Picture Marketing industry.  Invoice include music licensing, narration contracts, reporting to SAG/AFTRA and the EDITORS GUILD, and on and on and on it goes.


            There is no business like show business.


            So if you have a recommendation for a good audit trail tool I would love to hear about it.


            By the way, are you going to  DEV CON this year?

            • 4. Re: Logging Modifications

              I would recommend FMDataGuard for creating audit trails. It also offers the ability to roll back changes. Very cool.



              • 5. Re: Logging Modifications

                Yes, i'll be at DEVCON this year.

                • 7. Re: Logging Modifications
                  Jason Wood

                  Might want to check out this simple (and free) example from eXcelisys, the "Easy-Bake FileMaker Pro 13 Audit Trail"



                  • 8. Re: Logging Modifications

                    I'm using the eXcelisys custom function that Jason Wood mentions above in a solution, and it's handling the needs nicely. I looked at several approaches, but this fills the need until the client wants to fund a more complex or robust solution. The CF is free.


                    One note of caution, if you use it, to avoid a blank input on the first visit to the record, set a script trigger on the layout to commit records on record entry. This provides for catching all mods and properly captures the current content of the field, even changing an empty field to a filled field.


                    In this case (my application), the change-log is placed in a portal (on a tab) and not editable. A button is provided to print the change-log if needed, etc.

                    • 9. Re: Logging Modifications

                      FYI: Your link is broken for me (404), but this one works for fmDataGuard: https://www.linearblue.com/products/fmdataguard/

                      • 10. Re: Logging Modifications

                        I would roll my own logging service for this requirement as I understand it.


                        Being a Java developer, logging utilities (for Java) are free and simple to use and the ability (indeed, the expectation for production work) to put changes in a source code repository like Git or SVN is similarly free and simple (and integrated into most IDEs). Thus, I tend to avoid (in my view) expensive third-party single vendor solutions. Plus, I want to be in control of my code. The fewer third party companies in the mix with code I don't control, the better, in my opinion.


                        One way I'd consider going about this task (again, Java focus, but simple to do) would be to set up a simple logging service (a microservice) that can write your audit trail to virtually ANY format needed - usually just a text file, but not necessarily. The microservice could even write the logging back to the live FMP database if needed.


                        So, in FMP, you could create script triggers on the fields you want, say using the ON OBJECT MODIFY trigger. That trigger simply calls a common script (only need one script). You pass the script the field name and the new value, for example, and the script can do an INSERT FROM URL to POST the data to the service - which then saves it --- wherever you want.


                        Unfortunately, FMP as of version 15 still doesn't allow you to pass multiple parameters to a script (???) so you'd need to pass a string with sentinel characters (delimiters) for your service to recognize as parameters. Otherwise, your script would have to parse the "single parameter" which would, for lots of logging, probably best be left to fast Java code.


                        THEN, if you use a cool, and very inexpensive tool like "ExpanDrive", you can map any drive (or Mac, Volume) to your local machine. Hence, the log file could be ... anywhere. ExpanDrive is one of the coolest utilities I use.


                        Here are all the data stores you can map as "local drives or Volumes":

                        Once you map a drive to one of these services, you use that drive just like it's local. Thus, any program can read or write to it, "Locally", as though it's just another drive on your system. Performance could be an issue, since these drives are not truly local, but I've not had any issues with this product at all.




                        The FMP-only logging options may be your best bet, but, in any case, this is a free and simple alternative (and how I would do it).


                        HOPE THIS HELPS.