1 Reply Latest reply on May 13, 2011 2:57 PM by philmodjunk

    Keeping records in the database but hiding them from users

    Muffalupogus

      Title

      Keeping records in the database but hiding them from users & normal use (archiving them)

      Post

      Hi,

      I am working with a database and as we add new records and analyze old ones some become obsolete and I want to "hide" or "archive" them.  This will allow new additions and hopefully will allow me to prevent the import a duplicate record that we have already archived. Currently we have been deleting the records that were no longer of use but I quickly figured out this was going to be a problem as the database grew & evolved over time.

      So I am trying to do 3 things:

      1- create a script upon start-up of the general user account that will "find" and omit all of the records that have a "No" in the "Active Record" field I created.  newly imported records will have neither a yes or a no so this is why I just want to omit "No" records.

      2- create a button that, onClick, will change the status of the "Active Record" field for that record from "Yes" to "No" and then ideally actively filter out this record

      3- have a superseding find occurring in the background that will essentially perform the omit "No" find from 

      I have tried doing (1) and clicked "yes" on 5 of my 800 files as a test (oh, the Active Record field I made a radio button, but I don't think this should affect the script's recognition of "yes" should it?) and I have not been able to return any records for a simple script of:

      If [Get (AccountName) = "User" ]

      Perform Find [FIELD = "yes"]

      End If

      I'd appreciate any help or suggestions anyone may have on any piece of these 3 parts.  My boss ideally would like this done early next week and I'm still learning FMP and no one I work with ever heard of it until I suggested this would be a good way to try and manage this data so I'm sort of on an island.  Fortunately this island has the internet : )

      Thanks in advance!

        • 1. Re: Keeping records in the database but hiding them from users & normal use (archiving them)
          philmodjunk

          Best way is to use security settings to restrict access to your "Archived" records unless you have the database open with a password that permits it.

          See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.

          With this approach, any find perfomed by a script or by the user who has a privilege set that prevents access to archived records will automatically omit the records from the found set. If they use Show All Records or Show Omitted Only, the archived records will appear covered up with "No Access" displayed.

          The find script could then be as simple as:

          Enter Find Mode[]
          Set Field [YourTable::AnyNeverEmptyfield ; "*"]
          Set Error capture [on]
          Perform Find[]

          This would find all records for a Full Access user or any other user account were access to archived records is permitted, but other users would only see all non Archived records.