9 Replies Latest reply on Sep 25, 2015 5:18 PM by luiza.b.almeida

    Modal Window Script Bug


      Hi Everyone,


      I'm a newbie, so please excuse me if my question is dumb.


      Part 1:

      I'm building a database with important information in it with thousands of records. In order to prevent users from changing the information accidentally, I created an "Edit Info" button that takes you to a modal window (which is a different layout that has a "save" button and a "cancel" button for users to verify their changes before saving them). Everything was working fine, until I tried to log in as a user with limited access and I started to get notices like "Your access privileges do not allow you to perform this action." So, I decided to run a script debugger and it's finding Error #3 on many parts of my modal window script.


      Here is the script I wrote and linked to the "Edit Info" button:

      Screen Shot 2015-09-25 at 3.20.04 PM.png

      What is wrong with my script? How can I make it work?


      Part 2:

      How do I make the specific fields un-editable on that specific layout? I know I could can the in the security settings, but that would make it towards users wouldn't be able to edit the fields from the modal window either. I also know I could make that specific layout not available for modification, but that freezes all fields, including the button to take me to the modal window.


      Thank you

        • 1. Re: Modal Window Script Bug

          In answer to part 2 . . .  in the inspector you can set if a field can be entered into for either browse mode or find mode.  If you uncheck the browse mode they can not enter the field in browse mode and therefore can not make changes.  One down side of doing that is if you have an edit text box with a vertical scroll bar they can not entered into the field to scroll it.

          • 2. Re: Modal Window Script Bug

            This is great! Thanks!

            I had made a script to revert any changes, but that was a bit annoying for the users because they could get tricked into thinking that he could make changes... only to find out that their changes were not saved. This is much better.


            Do you have any suggestions on how I can debug my modal window script?


            Thank you

            • 3. Re: Modal Window Script Bug

              Error 3 means "command unavailable". Show / Hide Menu Bar is not available for Desktop.

              Check compatibility of your script steps.


              "Your access privileges do not allow..."

              Check your access privileges for the tables, layouts and scripts.

              Check for script triggers that want to do something outside of the allowed scope.


              You can disable access to fields on a layout by unchecking "Browse Mode" in inspector Data > Field Entry.

              • 4. Re: Modal Window Script Bug

                Hi election,


                Thank you for your response. What would be a better script for the modal window? Do you mind walking me through the steps or indicating a good site that has them?

                I'm getting Erro 3 on just about 90% of the steps. I'm not sure why. Does this mean that filemaker doesn't support modal windows?

                Thanks again

                • 5. Re: Modal Window Script Bug

                  You might also check to make sure you have the script itself set to run with full access privileges.

                  • 6. Re: Modal Window Script Bug

                    If the script itself is allowed for execution in that privilege set than it should not be a problem.

                    A better script without access is still worthless, this one isn't that far from OK.

                    Don't fancy the "Pause", clicking outside the fields will call for a commit so you might wanna think about that.


                    Reviewing the priv set would be the first thing to check. No?

                    • 7. Re: Modal Window Script Bug

                      keywords and election:


                      You're brilliant. Thanks.

                      So, I checked the priv set and the users were not able to run the scripts. Then, I allowed them to run the scripts, but now, when I click on the "Edit" button, I get this message: "This record cannot be modified in this window because it is already being modified in a different window." if I'm logged in as the user. Strangely enough, it works fine if I'm the Admin.

                      What could be going wrong?

                      • 8. Re: Modal Window Script Bug

                        Aside from some weird bug it seems the record is still open.

                        You could try putting a Commit Record on top of the script.

                        Because you're opening the same record in another window and you can only edit it in one place.

                        The open state is tied to the window.

                        • 9. Re: Modal Window Script Bug

                          Thank you! This is awesome. Totally solved the problem.


                          Side note: instead of putting "Commit Record" on top of the script, I put "Revert Record." Because "Commit Record" was overwriting my commands to cancel any changes if the user clicks the "CANCEL" button. It was making towards all changes were saved regardless. But the "Revert Record" on top of the script solved everything.

                          Now, users can edit the fields, save the changes and cancel them if they wish.


                          Thank you all so much for your help!