To Exit the active script when you press the "Revert" button on your layout you will need to change a setting on the button setup.
In Layout Mode, double click on your button to open up the Button Setting dialog and then in the options area for your Perform Script there is an option "Current Script:" this defaults to 'Pause'. Change this to 'Halt'
This controls the state of any active script that is running at the time the button is pressed and you have the options to Halt, Exit, Pause and Resume, and this action is carried out after the script specified in the button is carried out I believe.
I hope this helps
Orlando: I am using Filemaker 10; when I double click on the button for the button setup, the only option setup I get under revert record/request is to perform the function without a dialog box. I cannot seem to find the "Current Script:" this defaults to 'Pause'. Change this to 'Halt' area you describe. Any insights?
OK I thought the button was running a second Script that reverted the record, not calling the Revert Record / Request step directly.
Try setting up a second script that was simply, Revert and then if needed Go to Layout, then call that script from your Revert button on the layout and select the Halt option I mentioned above.
Let me know if this helps or not.
Orlando: Making the second script worked out well. thanks for the input. Maybe you know the answer to this: If I am scripting a dialog box and want to include the current field result in a dialog box, I have been making for each different layout of my tables a script dialog similar to "do you want" & Table:field. Rather than writing so many scripts for such a dialog box for each layout/table, is there any way to write one script and replace the script language for table:field name to reflect whatever is currently the field result in any open layout?
Glad that worked out for you.
With regards to your second question, it should be doable, but may depend on the version of FileMaker you are using, are you using FileMaker 10?
I am puzzled why are you pausing your script to begin with.
Re your second question, try using a script parameter.
Orlando, yes, I am using Filemaker 10
For your second question are you simply wanting to display the value of the field in the dialog message, or have the field in the dialog as an input field?
If its the first option then the simplest solution is to create your dialog message, as comment mentioned, in the Script Parameter and then have a sub-script that is simply a Show Custom Dialog step using Get ( ScriptParameter ) as the dialog message.
So your main script might look something like this:
Perform Script [ “sDialog”; Parameter: "Do you want " & Untitled::Field4 & "?" ]
# Your subscript runs with a dialog
If [ Get ( LastMessageChoice ) = 2 // Yes ]
Go to Layout [ “Untitled” ]
And your sub-script sDialog would simply be:
Show Custom Dialog [ Title : "Message" ; Message: Get ( ScriptParameter ) ; Buttons : “No” , “Yes” ]So when the user hits "Yes" in the dialog teh sub-script ends and you check the Last Message Choice result in your original script and act accordingly.And now you can call sDialog script from any number of scripts as long as you pass your dialog message through a Script Parameter.I hope this does the trick.