When my user is in Find Mode and press Enter or click Perform Find, I would like to be able to check if there is actually some criteria entered and instead of letting the query run and create an error, warn them to enter something. Is this doable?
Interesting question ! I did a search and found that (8 years old):
Can I get the user's find criteria before executing the find? (claris.com)
You use a Custom Menu to override the standard Perform Find action where you check if there were some criteria is set and either display an error message or call the regular action.
On the Script Triggers side, there is one called OnModeEnter. You could execute a script when entering Find Mode where you setup something in prevision of executing a Perform Find.
Some foods for thoughts.
Yeah, it is an interesting thread which I read thouroughly. Given its age, I was wondering if new ways had been found that would not involve so much scripting.
Knowing if a request has a criteria or not can be hard, specially if the UI letting the user set fields that are not on the layout, and / or there are multiple requests.
If error 400 is the only one you are concerned with, it may be easier to have your script (as I assume the find is scripted in some way) capture errors so it is not displayed to the user, trap for error 400 and get the user back in find mode, giving them feedback that they need to enter something.
Can you tell us more about the context? Do you have custom menus or a scripted process to handle this, or are you starting from something where users use the find mode natively without any script?
Native find. I’v decided that if they are grown enough to use the status bar, they can deal with their mishaps. I prefer to avoid leaving the status bar on and to control via UI but it is how they have been doing it.