3 Replies Latest reply on Apr 8, 2009 4:22 PM by philmodjunk

    Custom dialog - pre-enter and error checking. FM10.

    groovebox

      Title

      Custom dialog - pre-enter and error checking. FM10.

      Post

      2 posts in one day!

       

      OK - I am doing a multi-user solution - and for a couple of places I'd like to really lock down the error checking as much as possible. I read somewhere in the ether that you can create a custom dialog/window with some fields that allow the user to enter some data and then click (something like) a Submit button - do some error checking and if all OK add the record to the database.

       

      But I also heard that to begin with you need to create a new record BEFORE you display the dialog/window and run the error checking.

       

      I do have other error checking in place which works fine and I am not trying to lock this down 100% (because you can't!) - but it sort of intrigued me and I could see 2 places in my solution where it would be quite handy.

       

      I had a look through previous posts - but if anyone has a link to a past post it would be appreciated.

       

      Respect.

        • 1. Re: Custom dialog - pre-enter and error checking. FM10.
          philmodjunk
            

          It sounds like you are referring to "Show Custom Dialog". With show custom dialog, you can specify up to three "input fields" in your dialog. You can set these to store data in fields in an existing record or specify global fields, check for errors, create the record and use set Field to copy the contents from the global fields to the new record.

           

          There are significant limitations to using input fields in this dialog:

           

          1. You can't format the input fields with value lists
          2. Field validation error checks will not take place.

          Some clever developers have figured out how to use New Window to pop up a modal dialog. This approach can be a bit "clunky", but it does avoid the above two issues.

           

          The New window technique:

           

          Use new window and other window commands to open a small, new window,

          Use Go to layout to select the layout for your pop up dialog.

          hide the status bar.

          don't allow user abort

          pause the script.

          After the pause, enable user aborts, process the data (you might be using global fields like I mentioned earlier in this post.), and close the window.

           

          Define any buttons in this script to perform scripts that enable user aborts, close the window. Select the exit current script option for each button.+

          • 2. Re: Custom dialog - pre-enter and error checking. FM10.
            groovebox
              

            Thanks Phil - yep - I had a bit of a go myself - and the New Window thing is where it seemed to give me most of what I wanted but as you say - had the clunkiness thing going on. The Custom Dialog option is something I think I will play with next. (It is not critical but it was a "wow - I wonder if..." moment!)

             

            :)

             

            Appreciate your comments.

            • 3. Re: Custom dialog - pre-enter and error checking. FM10.
              philmodjunk
                

              When I upgraded from a much older verions of FMP, I was excited about being able to use input fields in Show Custom Dialog, but now almost never use them due to their limitations.

               

              I've chosen to put up with the clunkiness of New Window approach instead.

               

              In the meantime, I've posted a feature request that FMI add a "modal" parameter to the new window script step.