Can you post your script?
Thanks very much for your reply. I'm not in front of my computer and it's on a client's database but it basically says If DoNotEdit =1 in the record then show dialogue to user and then Exit Script, otherwise it just does Exit Script.
On the two Exit Script steps one returns "true" and one returns "false" like that - just typed in - I just can't remember which way round!
I'm sure it's just down to me not tinkering enough to get my head round it.
1. Exit 'true' & Exit 'false' are not for satisfying your If statement. They have more to do with triggers that fire before an event.
2. I dont think your record is locking due to looping, I just think it's ending. Although I would take the 'true' & 'false' out of your Exit Steps. Do any other scripts or script triggers fire after this scipt (OnRecordLoad) for example?
3. What happens when you run it thru the Script Debugger? I know you can tell tonite.
4. Where does/what is DoNotEdit come from? Is it a box you check? A global field? Stored/unstored calc?
It may be best to repost with answers when you're in front of the computer and someone will most likely answer and be able to help you quickly.
I'll have a look through tomorrow and see how I get on. Thanks for your help and these useful pointers.
Maybe there is another way to achieve what you want with an auto enter calc in your value list field. The attached has 2 fields: Condition and Test. Test has an auto calc that says if the result of Condition does not equal 1, allow a value list selection, otherwise use the result of Condition (which would be 1). You didn't say what version you are using; the attached is FM12.
Condition.fmp12.zip 9.5 K
I use two triggers for such a field. One that records the value of the field in a global variable and then another on exit that reverts the field if it should not have been changed.
Script triggers are great but I use them sparingly. In your example, can you guarantee that the user will exit the field in a timely manner?