I am reading thru the Missing Manual for FM 14 and, in the section on triggers, they state that this trigger will fire in Find Mode.
How would you use that trigger in Find Mode?
This seems to be a rather interesting bit of functionality.
If the user is in find mode and enters a find request. The Revert Record menu item is available, the User can then select this menu item and revert the request data that was input.
The Revert Record trigger is a Pre Event Trigger. This means that if the triggered script returns a 1 the action will complete or if the script returns a 0 the event will be cancelled. This would allow you to replace the Revert Record Dialog in Find Mode with a script that could prompt the user if they wanted to Revert the Find Request or Not. Hope that makes sense.
Are you trying to figure out when it triggers, or come up with a use for it?
So here's how FM is behaving in a Full access permission set with standard menus.
Enter find mode
Revert Record is not available from menu
Enter find criteria in a field but do not cause a "commit" of the criteria by clicking onto the layout.
Revert record is available from menu
Execute revert record from the menu fires the ORR() trigger and deletes the any entered criteria but does not delete the find request.
Executing revert request from the menu when their is more than one find request deletes the inn focus find request
Come up with a use for it. I'm just built that way. I always think that if FM built it that way their must be some use for it.
Yes, this is correct. This trigger is like the other triggers that you can trap for with Record Editing. For me the most important part is that your script can control if the action proceeds or not by returning 1 or 0. I have an application that makes heavy use of triggers like this and prevents the user from doing anything related to committing a record with out the application permitting it.
User interaction mostly, I guess. Provide an undo ( start over ) functionality for the user's find request and then suppress the filemaker dialog / substitute for your own? Like a custom menu that provides that or a button.
EDIT: Only you can't suppress the filemaker dialog.
If you were to create a find request, enter some stuff, commit the request, then go back, make more changes, and revert, I believe you'd revert back to the last commit, rather than deleting the whole request.
I honestly can't think of anything useful to do with this off the top of my head. I suspect it's there just because the revert record was already there in browse and it was easy enough to just have it work in browse mode. Some of those seeming "while we're at it" functionalities in FM have turned out to have unexpected and wonderful uses, so I for one am glad that FM doesn't implement things just for known use cases.
Retrieving data ...