9 Replies Latest reply on Nov 29, 2010 10:05 PM by david583

    Record Recycle Bin

    david583

      Title

      Record Recycle Bin

      Post

      FMPro10 & FMPro11, FM Server11. Windows Network (XP & Vista)

      I would like to create a recycle bin for deleted records as a bit of extra protection. Currently unfamiliar users are prevented from deleting but even the experienced ones make mistakes.

      I have been experimenting by exporting the record before it's deleted to another unrelated table. (deletes may occur from five different tables) but am having issues with scripting a restore function.

      Each Delete button has a script parameter of the table name, on export it sets the first field as the source table name and fills in each numbered field by custom export order (different for each source table). All Good. My problems begin with trying to restore the data. 

      Has anybody else attempted this successfully and willing to share a few tips?

      David

        • 1. Re: Record Recycle Bin
          RickWhitelaw

          Hi,

              I believe you're trying to delete the possibility of viewing a record rather than actually deleting the record. If this is the case you need to "fool" the user by, when he/she "deletes" the record, simply omitting that record from the available found set (or "viewable" set). IMHO there's no need to actually delete the record, or to create another table to store a record that has not really been deleted.

              RW

          • 2. Re: Record Recycle Bin
            david583

            Thanks Rick,

            I have seen this method before on this forum, my problem with it is I would have to go back through all my scripts and layouts to do this find on every layout load, and as some layouts already run scripts on load I would have to change all them as well.

            I thought it would be better to get it out of the data table completely, as in most cases we would want it deleted, only occasional delete errors would need to be restored.

            David

            • 3. Re: Record Recycle Bin
              davidanders

              Make a duplicate of the database for deleted records? export, import and viewing would be simpler.

              • 4. Re: Record Recycle Bin
                philmodjunk

                my problem with it is I would have to go back through all my scripts and layouts to do this find on every layout load, and as some layouts already run scripts on load I would have to change all them as well.

                You can use security settings to omit the "deleted" records from view. By making this change in Manage | Security, you'll keep the "deleted" records out of view for every operation but a few such as Show All records where you'll see the "access denied" screen shielding the "deleted" records. You can even use custom menus if you have FileMaker advanced to create your own "show all records" to keep this from happening if you want.

                • 5. Re: Record Recycle Bin
                  david583

                  Thanks David I'll give that a try.

                  Thanks Phil, that looks exactly what I need, however I'm stuck with 8 copies of FM10 on the network the boss won't upgrade, so I don't actually have a 'Manage | Security' control.

                  David

                  • 6. Re: Record Recycle Bin
                    philmodjunk

                    You have the same options, just under a different menu name. Manage | Access Privileges, if I remember correctly.

                    • 7. Re: Record Recycle Bin
                      david583

                      Now you have me really intrigued Phil, just how would I go about this?

                      I have changed privileges to prevent some users from deleteing, but I'm not familiar with hiding records this way. How do I omit the record from view?

                      • 8. Re: Record Recycle Bin
                        philmodjunk

                        In FileMaker help, look up: "Editing record access privileges"

                        Pay particular attention to the section titled: "Entering a formula for limiting access on a record-by-record basis"

                        • 9. Re: Record Recycle Bin
                          david583

                          Thanks Phil,

                          I had only used privileges to log in, I never thought of the power they hold, thank you for another ah-ha moment!