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.
Use Get(LastMessageChoice) and an If conditional step to decide how to branch:
If [ Get ( LastMessageChoice ) = theNumberOfYourCancelButton ]
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.
As erolst says should work.
If [ Get ( LastMessageChoice ) = 1]
OK button, do this.
Cancel button, do this
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.
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.
Retrieving data ...