5 Replies Latest reply on Apr 20, 2016 9:08 AM by DavidJondreau

    Duplicate and Auto-Enter

    brianc

      When you duplicate a record, any of FileMaker's native options such as serial number, creation date/time, modification date/time are all updated. However, my attempts to use any of those as a trigger within an auto-enter calc for me has failed.  I can accomplish this via scripting and/or custom menus, but I do not feel I should have to rely on that considering the nature of what I am trying to accomplish.


      I want to update my custom UUID when a record is duplicated.

       

      My hat is off to the developer that can point me in the proper direction.

        • 1. Re: Duplicate and Auto-Enter
          DavidJondreau

          Uncheck "Do not replace existing value in field..."

          • 2. Re: Duplicate and Auto-Enter
            brianc

            It's not checked.

             

            Here is my AE calc:

             

            Case(

            zz_UUID and $Audit.Rollback.Flag = 1 ; $Audit.Rollback.UUID ;

            zz_UUID and $$Audit.Populate = 1 ; GetAsNumber( CF_UUIDTimeNIC ) ;

            zz_CreateTS and IsEmpty(Self) ; GetAsNumber( CF_UUIDTimeNIC ) ;

            Self)

            • 3. Re: Duplicate and Auto-Enter
              brianc

              I think I just figured it out...

               

              Case(

              zz_UUID and $Audit.Rollback.Flag = 1 ; $Audit.Rollback.UUID ;

              zz_UUID and $$Audit.Populate = 1 ; GetAsNumber( CF_UUIDTimeNIC ) ;

              zz_CreateTS and IsEmpty(Self) ; GetAsNumber( CF_UUIDTimeNIC ) ;

              zz_CreateTS = zz_ModTS ; GetAsNumber( CF_UUIDTimeNIC ) ;

              Self)

               

              Sometimes just the process of asking the question helps to organize your thoughts.

              I will do more testing, but it looks like its working.

              • 4. Re: Duplicate and Auto-Enter
                brianc

                David, just for reference, do you have a calc that you use for your Auto-Enter UUIDs to make sure they update correctly when a duplicate record command is issued? I'm curious if there is a different approach that also works.

                • 5. Re: Duplicate and Auto-Enter
                  DavidJondreau

                  I just use the Get ( UUID ) in an auto enter calc with the option to Do not replace... unchecked.

                   

                  You have your auditing conditions and Self function that are interfereing. I, personally, would take that logic out and put it into a script (which you are using if you're setting a $var) and just have your UUID function stand alone.