Capture the original value of the field by passing the value as a script parameter to you OnObjectEnter script.
You can then use:
Set Field [Yourtable::YourcheckboxField ; get ( Scriptparameter ) ]
to revert the value of the field to keep it from changing on the first click or to ask for confirmation and then roll it back if the user decides against the change.
Thanks so much for the help! I like that but there are two things that don't seem to work for me:
1) Other fields don't have the same behaviour and so don't set
2) The script loops a few times for some reason - does "Set Field" trigger the "Enterfield" function?
My script is:
Show custom Dialog["Error"; "You have locked record. Do you really want to change it?"]
if[lastMsgChoice = 2]
What am I missing?
1) describe the other fields are they check box fields? If not, you need to use either a different script or you need to pass an additional value inside the parameter that tells the script the format specified for the field. (This method also works for pop up menus.)
2) Set Field does not trip any script triggers. Go to Object might--depending on what it goes to as that step puts the focus on whatever layout object has that name--which can trip an OnObjectExit trigger on the current field and an OnObjectEnter tirgger on the named object. If you have fileMaker advanced, you might want to test this script with the debugger and data viewer enabled so that you can watch things execute step by step to see if you can figure out why it appears to "loop a few times".
The other fields are text boxes. I could pass more parameters in to solve it but was hoping to get away with a "cleaner" solution. Oh well!
Even without the gotoobject it still repeats... I'll debug it and see - great idea!
Thanks so much Phil - you are great!