Yes, you need a trigger
look for "OnLayoutKeystroke" (to trap for enter key) or "OnModeExit" (to trap for exiting from find mode)
then you want to fire a script on either of the triggers.
To trap for enter key, you want to use Get(TriggerKeystroke) = 10. Code 10 is enter, code 13 is return.
Or for OnModeExit:you can just use a "modify last find" script step to put them back into their find anytime they try to change the mode on the layout.
Thanks. That is what I needed to know.
Took me a few minutes to realize after I had captured the Enter or Return Key I needed to have the layout script trigger run the script that is associated with the Perform Find button. After I put that in, it works like a charm. The Enter or Return Keys now act the same as clicking the button - an even better outcome than I had hoped.
1 of 1 people found this helpful
Yes, in layout mode select the "Data" tab of the Inspector. In the center of the Inspector is the "Behavior" segment. Check the "Go to next Object using" to use the Enter and Return keys.
Thanks. I had not realized that option was on the inspector
Another method is, since you have a dedicated layout, is to use global fields and stay out of Find Mode. Let the user do whatever they want with the fields in Browse and then make them hit a "Find" button to start the process. I use this a lot so that users never get into a bind with working in the wrong mode. I can also validate the fields one at a time before starting the Find. Using a script I walk through the fields inside "Find Mode" and process the ones I want. I then either go back to a "detail" page if 1 record found, a list is > 1 found, or popup a dialog re "no records found" and leave them on the layout for another try.
William - Thanks for posting this additional way to achieve my goal. It's good to know there are so many different ways to do this.