1 Reply Latest reply on Feb 16, 2017 11:31 AM by bburdeen

    Archiving records - deleting originals

    bburdeen

      Looking for some direction on archiving records. I have 2 tables; Table1 and Table1Archive. What I’d like to see happen is for a user to be able to check a box on different records. This check box would be labeled something like “Purge and Archive.” After going through and marking the records for ‘purge and archive’ the user would click a button that would copy these records into Table1Archive and then delete/purge them from Table1.

       

      We see Table1 expanding in such a way that we would not even want to filter archived orders. We just want them out of the way, accessible from a different layout if needed.

       

      What is the best way to manage this?

        • 1. Re: Archiving records - deleting originals
          bburdeen

          Found something on the inter-webs that works locally, just not sure if it’ll work on a server. I’ll have to test, of course.

           

          Set Error Capture [On]

          AllowUser Abort [OFF]

          Go to Layout [ “Table1” (Layout1) ]

          Perform Find [ Restore ] //Looking for records that have a field checked where field=X

          If [ Get ( LastError )> 0 ] //checking for no finds

            Exit Script [ ]

          Go to Layout [ “Table1Archive” (ArchiveLayout) ]

          Show All Records

          Import Records { No Dialog ; “Filemakerapp.fmp12” ; Add; Mac Roman ] //This is what I’ll have to test on the server — the path

          Go to Layout { “Table1” (Layout1) ]

          Perform Find [ Restore ] //Looking for records that have a field checked where field=X

          Delete All Records [ No dialog ]