10 Replies Latest reply on Aug 28, 2015 2:02 AM by rrrichie

    Disabling/Changing Field Behavior Using Scripts (no double layout)

    contactmip

      using two layouts/ in order to play with field behavior looks really a very heavy and hard maintenance way of working to me.

      so I was naturally looking for a simple function that would to that easily. Apparently FileMaker developers don't care about this.

      i So do hope I'm wrong in my statement.

       

      So in case someone has The Great Solution I guess I have no other choice but double my field with one toggle script to hide/show it.

      I Just want to make a field editable or not depending of a value that is entered in another field.

       

       

        • 1. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
          tomasd

          You can add script trigger (object enter) on the field and simple script - go to different object in order to prevent modification.

           

          I will appreciate new function in FileMaker to conditionally enable/disable element too, but they didn't implement it yet.

          • 2. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
            jbrown

            So in case someone has The Great Solution I guess I have no other choice but double my field with one toggle script to hide/show it.

            I Just want to make a field editable or not depending of a value that is entered in another field.

            You certainly can make a field editable depending on the value of another field. Script triggers provide such functionality. You could write a script for the trigger of onEnter for the 2nd field to check the value of the 1st. If the 2nd field shouldn't be editable, commit the record or go to another object, thus leaving the field. Or do the hide-show thing. Hide the editable 2nd field if the value of the 1st field meets demands. Hide the read-only field if the 1st field allows the 2nd to be editable.

             

            For groups of editable fields, I'm using a popover on a read-only layout that contains those fields which can be edited. Its a simple way to get add read-only/ edit mode functionality out of one layout. This also allows for the changes to be commited or reverted. A user could cancel all 10 changes he/she made and the record would revert back to the original one before the edit.

             

            I think FileMaker developers do care about it and have ways that works.

            • 3. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
              coherentkris

              I'm guessing your question is how can someone make an data entry control ( edit box, drop down, calendar control, pop up) editable or not depending on the value in another field without creating a seperate layout for edit OR a duplicate control for edit only.

              1. You could leverage the OBJECT level script triggers that fire PRE event Understanding and using Script Triggers | FileMaker

              2. You could leverage the security settings of a custom privilege set to allow record level edit of the field on the evaluation of a conditional. Look in help for editing record access privileges.

               

              I would try to leverage the security model method first because it functions system wide so does not depend on you to put the control in every layout that needs it.

               

              Im sure there are other ways to make this happen but these are the first two that come to mind on a Monday morning

              • 4. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
                rrrichie

                Depends what you want to do as well... I have some layouts where someone first has to enter a pin.  All other fields are hidden until the pincode is entered.

                 

                On some layouts users can edit until some status has been reached (invoice paid e.g.)  On some I have two fields on top of each other one is editable the other not.  Then a formula hides the editable one when the invoice has been paid.

                 

                The hide element is available since FM13.  Before that I used to disable data entry, then place a button on the field, with a goto field if the user was allowed to edit it, that worked in really old filemakers too.

                 

                Then as tomasd mentioned I've also used the script trigger method with the on object enter event.

                 

                I guess by FileMaker Developers you mean FileMaker self and not "us" :-)  Cause I develop a lot in FileMaker and I do care, but FileMaker does seem deaf to some requests.  One day we will all use something else and say, "Oh if FileMaker only could have done that... " I also do more and more php/javascript work now

                • 5. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
                  jbrown

                  I guess by FileMaker Developers you mean FileMaker self and not "us" :-)  Cause I develop a lot in FileMaker and I do care, but FileMaker does seem deaf to some requests.  One day we will all use something else and say, "Oh if FileMaker only could have done that... " I also do more and more php/javascript work now

                  I beg of you, let's not turn this into another complaint thread.

                   

                  I've asked this question as well in the past and have found reasonable solutions. I'm not really sure this is lacking. in Javascript, wouldn't you have to do the same: toggle on and off a field's editable property. I assume that would have to be done via scripting: if x is true, then make field a editable. If x is false, make field a read-only. Script triggers do the same and the hide/show functionality works as well.

                   

                  How else would you want it to be done? A specific calculation dialog similiar to the hide-show dialog calc box? That's a decent idea, so post it as a feature request. But at the moment, it doesn't feel like this is something FileMaker missed, ignored from the community, failed to implement, etc...

                  • 6. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
                    rrrichie

                    Good point Jeremy !  I think we all have our unresolved issues and sometimes they find a way into the open.

                     

                    But a calc box for the data checkbox would be nice.  Probably the most flexible would be if we could have a script function where we can set any attribute of an object.  Like SetAttribute ( objectname, attribute, {options} )  That way we can also put the conditional formatting in a script.  You would need to look up the information, because making this work with checkboxes etc would be too much.

                     

                    Thanks again for the tick on the fingers (that reminds my of elementary-school), it did inspire this SetAttribute function, for which I will add a feature request as soon as I hit Add Reply :-)

                    • 8. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
                      contactmip

                      thank you guys for your posts.

                       

                      and sorry to have opened a complaint thread

                       

                      this said, I totally agree with Rrrrchie.

                       

                      I dislike the idea of selecting another object. This is more like a desperate trick and not professional at all. Let imagine we have several fields to manage this way it becomes more an electric flipper game than a serious app. Conceptual clever tricks are much more prefers, in my opinion.

                       

                      now that I'm starting getting better at developing with FM and kind of enjoy it, I'll be a very active request features

                      and just to be a little bit picky French dev, from an Apple subsidiary, I expect more easy managing solutions and tools

                      OK, no more!!! These frenchies are soo arrogant - LOL

                      Cheers guys! And once again, thanks for your posts and great friendly help   

                      • 9. Re: Disabling/Changing Field Behavior Using Scripts (no double layout)
                        TSGal

                        Ramon Richie:

                         

                        The FileMaker forum Feedback board is no longer available, and those posts were not migrated to the Community.  Although I did read your post, the best place to enter product suggestions is the Feature Requests web form at:

                         

                        Company | FileMaker

                         

                        All suggestions submitted through this web form populate a database file that is hosted and monitored by Product Management and Development.  All entries are read, discussed and considered for possible implementation in a future release.  Although I could copy your post and paste it into the web form, there are a few questions asked on the form that only you can answer.

                         

                        TSGal
                        FileMaker, Inc.