1 Reply Latest reply on Sep 27, 2010 10:40 AM by philmodjunk

    Trouble creating audit log

    ShaunG-B

      Title

      Trouble creating audit log

      Post

      I am working with a client who uses Filemaker Pro 11.

      I have been trying to create an audit log so that they can track all changes to the database, for example when Staffperson1 changes an email address, the audit log would display the date & time, username of Staffperson1, and what changes were made to the email field.

      I have been following a guide written for Filemaker Pro 7/8 by Andrew Persons which says to create an AuditLog field and a AuditFields... I am close to getting it to work but I keep getting an error message when I am trying to define the calculation of AuditLog1 field.

      I've been able to write out the calculation for AuditFields1 correctly:

      Substitute (main first name & "|" & main last name & "|" & Org Address Line & "|" & first address & "|" & second address & "|" & city & "|" & state & "|" & zip & "|" & phone & "|" & email & "|" & website & "|" & home phone & "|" & work phone ; [ "¶" ; " * " ] ; [ "|" ; "¶" ] ) & Left (AuditLog1 ; 0 )

      But I am having trouble with AuditLog1.  Here is what I have entered just for the first field called main first name (following instructions from the guide by Andrew Persons):

      Let ( [ main first namePrev = Substitute ( MiddleValues ( AuditFields1 ; 1 ; 1 ) ; "¶" ; " " ) ;
      main first nameCur = Substitute ( main first name ; "¶" ; " * " ) ] ;
      Case (  main first nameCur ≠ main first namePrev ; Get ( CurrentHostTimeStamp ) & ": " & Get ( AccountName ) & " changed " & Get ( ActiveFieldName ) & " from \" " & main first namePrev & "\" to \" " & main first nameCur & "\"¶" ; ) & AuditLog1

      It keeps telling me: There are more “)” than there are “(” or there are more “(” than there are “)”.

      Can someone please help me figure out what needs to be fixed in the calculation I've written out above? I have tried a lot of things and have not been able to get it to work.

      Thank you. ~ ShaunGB