4 Replies Latest reply on Sep 19, 2010 2:08 PM by mattb

    Suppressing unwanted warning dialog box



      Suppressing unwanted warning dialog box


      Here's the situation:  I have a screen with a portal.  The user types information into the first portal cell and then presses Tab, expecting the cursor to wind up in the second portal cell for input, but instead the cursor just loses focus (there are no other input fields on this screen).  Then on the first keystroke, the ubiquitous "Before typing, press Tab or click in a field, or choose the New Record menu command." warning box comes up.  

      I've had success using the "Set Error Capture On" script step in suppressing other warning messages, so I attached this to an On Layout Enter script trigger, but it doesn't work.  I don't want this message coming up every time the user hits a key when the cursor isn't in a field - it's much better that they hit a key and have nothing happen than to have them see this message and be forced to click OK.

      So...I'm hoping there's some way to prevent this message from coming up in these situations, but how??

      Matt Bloomfield

        • 1. Re: Suppressing unwanted warning dialog box

          One workaround for situations where you want to get cleanly out of a field (drop-downs can sometimes need this) is to create a "dummy" field. Set it to allow entry. I use a Container field (with global storage), as it does not care what the font size is. You can make it really small, 1x1 pixel. Set it to be after your field in the tab order, so it gets focus. If you look close, you'll see it as a black dot. You can hide it behind something else (if there's anything handy to hide behind). It never has data in it, so never needs to be included in Imports or anything.

          • 2. Re: Suppressing unwanted warning dialog box


            Interesting idea.  I tried it and it didn't work.  I made a dummy field and left it visible and large enough just to check the behavior.  What happened is with the cursor in the editable portal field, I clicked Tab and the outlines of the dummy field became solid, ostensibly indicating it now had the focus, but there was no cursor showing and when I hit a key, I still got the dreaded message I was trying to avoid.  Oddly, when I changed the tab order so that the dummy field was #1 and the portal field was #2, and performed the same experiment, I did not get the warning message, but I did get an audible beep out of the computer, so I guess that's kind of a workaround, at least as far as the warning message not coming up.  In my case, I have a button on the screen, so I don't really need the dummy field - I just assign tab order #1 to the button and it behaves the same way.

            I also discovered if I remove the check from the Tab checkbox of the "Go to next field using" property, then the Tab key acts like a Tab key on a typewriter, i.e. it moves the cursor up 5 spaces within the same field, and so avoids the warning message as well.  I'm not completely thrilled with either method (audible beep or moving the cursor in the same field), but in both cases the warning message no longer comes up, so it's an improvement.  I'm looking forward to see if there are better alternatives to this situation still...

            Matt Bloomfield

            • 4. Re: Suppressing unwanted warning dialog box



              To save time for others from having to peruse the linked thread, I'll summarize:

              On Layout Keystroke

              If [Get(ActiveFieldName) = "" ]

               Exit Script [result:False]

              End If