2 Replies Latest reply on Jan 28, 2014 8:21 AM by easyway

    Cannot escape from looped dialogue box

    easyway

      Title

      Cannot escape from looped dialogue box

      Post

           I've just created lock fields for two field in the database and using the OnObjectEnter script procedure which was working fine in a new layout I created to test it.

           However on the final test I after adding the script to the second field I wanted to lock I appear to be locked into a loop which I can't escape from: my own dialogue box text saying "Existing data cannot be changed" comes up with a "Cancel" button and an "OK" button but clicking on either of these simply causes the dialogue box to flicker and the cursor remains in one of the fields which can't be modified. Nothing else is clickable except these two dialogue buttons so I'm trapped. I can't close file or even the programme.

           Any ideas anyone? Or am I really in the soup?

        • 1. Re: Cannot escape from looped dialogue box
          philmodjunk

               And what does your script do besides display the dialog. I'd guess that you need to add these steps to move the focus out of the field so that the script doesn't trip its own script trigger:

               Go to Field  or Go to Object Here to put focus someplace "safe".
               Exist Script [False] --> cancels the "enter" event so that focus is not left in the "locked" field.

               But you might want to consider an alternate approach that does not need any scripting:

               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. Re: Cannot escape from looped dialogue box
            easyway

                 Thanks Philmodjunk, I've realised what I've done because following advice from somewhere else on a forum I unthinkingly put in script to move to next field at the end. As there were only the two field I wanted to protect and the two relevant lock fields on the layout I'd created, there was nowhere else for it to go but back to the first field I wanted protected and thus tripping it's own script trigger!!. Your advice of moving into somewhere safe makes sense and is necessary as otherwise it reverts to the field and although it won't allow new data to be entered it does allow the cursor to be moved backwards so deleting the existing data.

                 Thanks again for your quick assistance. In answer to your question I've been using Filemaker products since Version 2 years ago but only occasionally as an adjunct to my normal work.