3 Replies Latest reply on Oct 14, 2015 2:28 AM by noelmorris

    How to prevent a container field from being overwritten?

    noelmorris

      Hi, I have a FMP12 database using a container field to store a variety of files (jpeg, png, giff, pdf, doc etc) (Family history related). It is too easy to drag and drop another file on an existing one, and overwrite the original file. How can I protect the original file yet still allow the occasional modification?

       

      I am thinking that when a new file is added (drag & drop or menu-entered) that a pop-up window would ask "Do you want to overwrite this file?" with options "Yes - No - Make new record"

       

      The methods that I have tried all require setting permissions too permanently.

       

      There is no password required, and only on desktop Mac.

       

      Does anyone have a simple solution to this problem?

       

      Thanks in advance,

       

      Noel

        • 1. Re: How to prevent a container field from being overwritten?
          mikebeargie

          easiest thing to do would be to use two container fields showing the same container. Then you can use the "hide object when" feature of filemaker to hide the "editable" container with a calc of:

          Not isEmpty(table::container) AND $$editing <> 1

          make yourself a button to turn editing on/off that sets the global variable $$editing as appropriate.

           

          On the container you display when this is hidden, simply uncheck the box that allows entry to the field in browse mode.

          • 2. Re: How to prevent a container field from being overwritten?
            carlosilvia0

            Hi,

            I duplicate container field in the form, the first with " field entry " browse mode active and " Hide object " when not IsEmpty(<field name>), the second is complementary: " field entry " browse mode not active and " Hide object " when IsEmpty(<field name>).

            Then align the fields.

             

             

            What do you think?

            • 3. Re: How to prevent a container field from being overwritten?
              noelmorris

              Hi, thanks both of you for your replies. The little bit of info that had eluded me was the use of the field entry browse mode checkbox. So I made two tabs: "View" and "Edit" and made duplicate container fields one on each tab, with the "View" one having the browse mode box unchecked. Then a script trigger to switch back once an edit was made. And a "New File" button to go straight to the "Edit" tab.

               

              Thanks for your help. I find my database projects are somewhat spasmodic and it is easy to forget the little things that make a difference and you have helped me get this project under way again.