2 Replies Latest reply on May 22, 2017 5:54 PM by philmodjunk

    Find and Replace in specific fields only


      Is there a way to prohibit "find and replace" from some fields but allow it in others.

      I would like users to be able to modify most fields, but only use the replace option in very few fields.

      Too many things are being replaced when they should not be.


      Thanks for your help.

        • 1. Re: Find and Replace in specific fields only

          It sounds like perhaps the users of your solution are using the find and replace function more than you'd like, but you'd still like them to be able to modify most fields? If this is the case, that rules out disallowing field entry in browse mode.


          You might try.... create a custom menu copy of the Edit menu (with FileMaker Pro Advanced) and remove the Find/Replace menu item entirely from the Edit menu, then attach the custom menu to the layout in question. No more Find/Replace.


          Then create a scripted find/replace function: create a script that displays a custom dialog with input fields assigned to global fields to store the find value, and the replace value. Then, store your context in a variable, freeze the window, then loop through your records/found set and use an IF statement in the loop to check the field comparing its value to the value stored in the find global field, something like "If GetField ( get(ScriptParameter ) = global::find_value then set field by name (get(script parameter); global::replace_value) to set field equal to global replace value, end if, go to record/request/page next, exit after last, end loop..... then go back to wherever you were, as stored in your variable to preserve context, refresh window, exit script.


          On the layout, create a button by the very few fields you wish to allow find/replace, and attach the script to the buttons. Pass the fully qualified name (table::field) of the field being found/replaced as a script parameter to the script on each button according to whatever field you are using the custom find/replace script for.
          Screen Shot 2017-05-22 at 7.29.31 PM.png

          • 2. Re: Find and Replace in specific fields only

            It might be helpful to post some examples.


            One way to limit the standard Find/replace to specific fields is to set up a layout with only the fields  that you want to permit F & R present on that layout. When a user wants to do this, take them to this secondary layout--possibly in its own window for the F & R.