10 Replies Latest reply on Feb 6, 2012 8:18 AM by timwhisenant

    Replace Field Contents

    IT_User

      Is there an easy way to disable the "Replace Field Contents" for everyone except those who have Full Access/Admin privileges?

      I know I could probably script it like...

       

      Get PrivilegeSetName

      Check if Full Access

      If so,

      Replace Field Contents

      Else

      Do nothing or send a message

       

      Then I would change that in Custom Menus

       

      But I wasn't sure there could be another way.

        • 1. Re: Replace Field Contents
          Stephen Huston

          Yes.

           

          Custom Menus, which can be created and edited using FileMaker Advanced.

           

          You can then use a script step to install the appropriate version of the Menus depending on user permissions, and/or set which menus are default for each layout.

           

          I ALWAYS remove the Replace options, including Replace Field Contents, and the Find and Replace. It's just too much power to leave open to users. I use them sparingly myself for data cleanup, but only after runnning a backup since there is No Undo.

           

          Worht the cost of Advanced if you don't have it, along with Custom Functions, and a bunch of other neat tools you'll learn to use all the time.

           

          Stephen Huston

          • 2. Re: Replace Field Contents
            IT_User

            Thank you Stephen

            That should be helpful for others who are wondering how to do it.

             

            I do find that Replace is too powerful, especially without an Undo.

            • 3. Re: Replace Field Contents
              RayCologon

              IT_User wrote:

              ...I do find that Replace is too powerful, especially without an Undo.

               

              Hi IT_User,

               

              The lack of an 'undo' option is one issue, agreed.

               

              Arguably more problematic, in my view, is the fact that the command doesn't 'play nice' in a multi-user setting. That is, records that are locked by another user are skipped - a generic error dialog (or error code, if its an error trapped script) is returned, but there's no straightforward way to know which records didn't get updated.

               

              Coupled with the fact that even files that are designed from the outset to be single user often end up being hosted at some point in their life, and most uses of the Replace Contents command are questionable, IMO.

               

              Regards,

              Ray

              ------------------------------------------------

              R J Cologon, Ph.D.

              FileMaker Certified Developer

              Author, FileMaker Pro 10 Bible

              NightWing Enterprises, Melbourne, Australia

              http://www.nightwingenterprises.com

              ------------------------------------------------

              • 4. Re: Replace Field Contents
                Mike_Mitchell

                Show of hands of those who've had robot routines go bad because of this?

                 

                (hand raised)

                 

                 

                • 5. Re: Replace Field Contents
                  timwhisenant

                  And yet this is covered in the Filemaker Training Series in Module one! So powerful and dangerous at the same time.

                   

                  I also shy away from any use of “Replace Field Contents” in production code.

                   

                  IMHO, It is for personal up-close data manipulation to be done by a single user with intimate understanding of the data and database.

                   

                  I rarely use it myself and do so only after a backup, with my fingers crossed. Not that I doubt the command, just the thought that it cannot be undone and it is very quickly changing the data across your entire found set of records. Oops, just doesn’t cover the fear of disaster possible when goes unexpectedly.

                   

                   

                   

                  Tim

                  • 6. Re: Replace Field Contents
                    skywillmott

                    ... The 'Delete found records' menu also a landmine waiting for inexperienced users to explode if not removed or replaced with a custom menu action!

                     

                    Sky

                    • 7. Re: Replace Field Contents
                      IT_User

                      Agreed, to all of you.

                      I know I only specified one command, but there are others.

                      "With great power, comes great responsiblity"

                       

                      Oh, well...thanks for all of your input.

                      There are things here I hadn't considered, but now that I see them I stand more firm in wanting to block the Replace commands and other similar things.

                      • 8. Re: Replace Field Contents
                        Malcolm

                        On 04/02/2012, at 6:00 AM, timwhisenant:

                         

                         

                        I rarely use it myself and do so only after a backup, with my fingers crossed. Not that I doubt the command, just the thought that it cannot be undone and it is very quickly changing the data across your entire found set of records. Oops, just doesn’t cover the fear of disaster possible when goes unexpectedly.

                         

                         

                         

                        I make it a habit to do an export of the field that is about to be replaced immediately before running the command. If there is any sign of trouble an import can reset the data quite quickly.

                         

                        After having done this for a while, I started to realise that doing an export offered me a more powerful tool set. I can use a text editor with good regex or the command line to use perl/sed. Any mistakes can be thrown away. The command line tools are often much faster than Filemaker. It is also possible to export all the associated data needed to do more complicated replaces. It's not the answer to every situation but it is safe and reliable. 

                         

                        Malcolm

                        1 of 1 people found this helpful
                        • 9. Re: Replace Field Contents
                          IT_User

                          After having done this for a while, I started to realise that doing an export offered me a more powerful tool set. I can use a text editor with good regex or the command line to use perl/sed. Any mistakes can be thrown away. The command line tools are often much faster than Filemaker. It is also possible to export all the associated data needed to do more complicated replaces. It's not the answer to every situation but it is safe and reliable. 

                          Oh, regex, how I do miss using those.

                           

                          And that is probably a good idea. Now I just have to learn how to use perl/sed : P

                          For efficiency that is a good thing to keep in mind. Thank you

                          • 10. Re: Replace Field Contents
                            timwhisenant

                            Malcolm,

                             

                            That’s a good idea, and hadn’t occurred to me before. One great advantage of this and other forums is the wealth of viewpoints which open up possibilities.

                             

                             

                             

                            Thanks for the post,

                             

                            Tim