3 Replies Latest reply on Jun 1, 2016 7:33 AM by fclark

    Cancel Button in a custom dialog

    sherab4

      How do I cause the window to revert back to Browse mode once the Cancel button has been click in a Custom dialog. At the moment it remains in find mode. the script I am using is attached.

        • 1. Re: Cancel Button in a custom dialog
          erolst

          Use Get(LastMessageChoice) and an If[] conditional step to decide how to branch:

           

          If [ Get ( LastMessageChoice ) = theNumberOfYourCancelButton ]

          do this

          Else

          do that

           

          btw, it's a good idea to enter Find mode before you switch layouts, so you don't have to load a found set you're not interested in.

           

          Also, if you use a custom dialog for data entry, you should check the data on validity. It's easier if you use a global field for data entry and have FM do the check for you, based on the field's data type.

          1 of 1 people found this helpful
          • 2. Re: Cancel Button in a custom dialog
            Stigge

            As erolst says should work.

             

            If [ Get ( LastMessageChoice ) = 1]

                 OK button, do this.

            Else

                 Cancel button, do this

            end If

             

            i never tryed it.  but am guessing by checking the "Commit Data" on Cancel field.

            You can then use If [ Get ( LastMessageChoice ) = 2] to get to the Cancel option..

            But thats only my guess =) never used it.

            • 3. Re: Cancel Button in a custom dialog
              fclark

              You do not have to check the commit box to get access to get(lastmessagechoice) = 2. but if you have data in a field in the dialog window the commit must be checked to have access to that data.