3 Replies Latest reply on Jan 29, 2016 11:24 AM by igor

    Auto-Enter modification name updated by lookup script



      This could be an easy question but is driving me crazy.

      I have a server based script performing a re-lookup of values from calc field "A" to text field "B" once per day. The field "C" is a auto-enter text modification name field, that normally stores the record modifiers name. Now, when the lookup script is performed, it runs through all records in the table and by that automatically updates the value in the field "C" with the name of the script itself. Basically it overwrites all the pre existing values in the field "C".

      Is there a way to avoid auto-update modification name in the field "C" by the lookup script?

      Thanks for any suggestion in advance!


        • 1. Re: Auto-Enter modification name updated by lookup script

          Perhaps add a case statement to your field c auto-entry, so that if the "user" is a script, the old value in field c is reentered?


          Chris Cain


          • 2. Re: Auto-Enter modification name updated by lookup script

            There's two ways...


            1) Use an additional field that references C, but not when the script is running and use that instead of C to display the modified by.

            2) Change C so it references all the fields you want to trigger the name change on and put an exception in for when the script runs.


            See, FileMaker's "Modification" options are pretty unique within FileMaker. You can't auto-enter whatever you want on any field modification, only the timestamp, account name, user name, etc. options.


            So, you can either reference that feature in another field, or recreate it.


            Referencing it, means create a new field, C_Real . Have C_Real auto-enter this:

            Let(  trigger = C ; Case ( $script.running ; Self ; Get ( AccountName ) )

            Add a Set Variable [ $script.running ; 1 ] to the start of your update script.


            You can replace that function by moving the "modification" checkbox ability into the auto enter calculation box.

            Let ( trigger = FieldA & FieldB & FieldD & FieldD ;

            Case ( $script.running ; Self ; Get ( AccountName ) )

            Hope that helps!

            • 3. Re: Auto-Enter modification name updated by lookup script

              Hi David,

              Thanks for your clearly explained options, that both worked perfectly!

              I've opted for the first (referencing) one, since there's a lot of fields in this layout, but the auto-enter calculation is an option for other uses.

              Much appreciated your help! Thanks

              Thanks Chris for your help too!

              BR, Igor