3 Replies Latest reply on Oct 26, 2016 8:27 AM by philmodjunk

    Make field only editable if clicked




      As was control field input behaviour from inspector; I was wondering if there any way of writing a script to do it.


      I got a portal which shows some records. I have disabled field entry from inspector so records cannot be editable in browse or find mode. I have also placed edit icon in record row. What I actually wanted is if we click the edit icon; the clicked row become editable. I wounder what would be the best way to do it so when you click the edit click button; that specific row become editable so user can edit it.



      Many Thanks

        • 1. Re: Make field only editable if clicked

          There are a few ways to do it.


          1) Stack a second set of fields on top of the first that has "edit in browse mode" enabled. Give those fields a "hide object when" calculation of $$edit = 1. Then tie a script to your "edit" button that sets $$edit to 1, and goes to the first field in the portal row.


          2) Copy the entire portal, fields and all, into a second slide of a slide control object. Have your edit button "slide" to the second slide, where you will have that copy of the portal available for edits.


          3) Take the user to a copy of the layout that has editing enabled.

          • 2. Re: Make field only editable if clicked

            This would be best handled in the privilege set of the user.

            Set the user's Privilege set for the portal's table to "limited" and allow editing only when the edit field = "Y"


            Then have your "edit button" set the edit field to "y"...and clicking it again sets the edit field to ""


            Clicking the button for that portal record sets the edit field to "y"...they can edit it...then they have to click again to stop editing.


            Another way is to use that edit button to open that record in a new window on that record with the fields open in browse mode...

            • 3. Re: Make field only editable if clicked

              One method would be to set up an access control expression in Manage | Security such as

              Not Lock


              where Lock is a new number field added to your table that auto-enters True. (Use Replace Field contents to set all existing records to this value when you make this change).


              A script set to run with full access privileges can set this field to False to unlock editing for the record where you made this change.