2 Replies Latest reply on Jun 26, 2014 7:34 AM by NicoleCiemniak

    Changing text box from editable to non-editable ONLY for certain records

    NicoleCiemniak

      Title

      Changing text box from editable to non-editable ONLY for certain records

      Post

           Does anyone know whether it is possible to change the behavior of an item in a layout (e.g. a textbox) depending on the record being viewed? Specifically, I want the textboxes in my layout to change from being editable to being non-editable in browse mode after I decide that the work on that record is done – perhaps through pressing a button, or through choosing a specific option in a drop down menu. I am 90% sure this is impossible, but I wanted to check!

           -Nicole

        • 1. Re: Changing text box from editable to non-editable ONLY for certain records
          philmodjunk

               3 options to consider:

               1) If your file is password protected and your users have less than full access accounts, you can set up a "lock expression" that does not allow changing any field in certain records. If that sounds like a possible solution, 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 description of how to set this up.

               2) On the other hand, if this is primarily to "prevent accidents", you can set up the OnObjectEnter trigger to perform a script that checks to see if this record can still permit editing in this field. If not, go to field, go to next field or go to object can be used to move the focus back out of the field. This trick can, however, be circumvented by using drag and drop to modify the field as this action does not trip this script trigger.

               A validation field option can be set up with a calculation that does not accept changes to this field when the calculation indicates that this field should be "read only". This allows the user to attempt a change, but when the record is committed, it shows an error message and they have to revert the record. So it's not very user friendly, but it's a good "back up" to the script trigger method as it will catch a drag and drop produced changes.

               3) You can also set up two identical layouts or a single invisible tab control or slider where one layout or tab/slider panel has an editable copy of the field and one has a read-only copy. OnRecordLoad then is used to perform a script that either changes layouts or uses go to object to change tab/slider panels to control access to the field.

          • 2. Re: Changing text box from editable to non-editable ONLY for certain records
            NicoleCiemniak

                 Wow, thank you! I'll try out these options, sounds great.