Matthew R White Posted March 23, 2015 Posted March 23, 2015 I'm looking for a way that when a user enters find mode, a script is performed and also after entering text in field and hitting enter another script is performed. Whats the best way to implement this, or is there an Always On ability for scripts? Thanks Matt
bcooney Posted March 23, 2015 Posted March 23, 2015 Can you be more specific and describe the scenario? Are you looking to add to their find criteria and then process the find?
Kris M Posted March 23, 2015 Posted March 23, 2015 You could use the OnModeEnter/Exit script triggers to perform actions when find mode is accessed on a layout. You could also take over the View>Find Mode menu item with a custom menu that would function on any layout where the custom menu is exposed. as bcooney was said need more info on what you want 1
Matthew R White Posted March 23, 2015 Author Posted March 23, 2015 Once a user enters find mode I'd like the curser to select a certain field to enter the find data. Once data is entered and enter key is pressed I'd like to perform the find then scroll to the right of all the records to find the most current record everytime
bcooney Posted March 23, 2015 Posted March 23, 2015 you can use the OnModeEnter trigger with a Go To Object script step, simply name the field. Not sure what you mean by scroll to the right of all records. FM scrolls down lists, not across.
Matthew R White Posted March 23, 2015 Author Posted March 23, 2015 Perfect the OnModeEnter worked great! How do I tell filemaker to perform a script after I've entered find mode, then entered text and hit enter?
bcooney Posted March 24, 2015 Posted March 24, 2015 How do your users enter Find mode? This is what I mean by providing us with much more detail. You'll get better answers.
Kris M Posted March 24, 2015 Posted March 24, 2015 Once a user enters find mode I'd like the curser to select a certain field to enter the find data. Once data is entered and enter key is pressed I'd like to perform the find then scroll to the right of all the records to find the most current record everyt you can trap for individual keystrokes with the OnObjectKeystroke trigger.s. You can control what happens when you exit an object with the OnObjectValidate/Save/Exit triggers. Here is the FM ref on triggers that you should spend some time with because their are nuances that you need to know when working with triggers i.e firing order, can they interrupt the calling action, . http://help.filemaker.com/app/answers/detail/a_id/7465/~/understanding-and-using-script-triggers Here is another "goto" resource for triggers from Soliant http://www.soliantconsulting.com/blog/2014/01/script-triggers-filemaker-13
bcooney Posted March 24, 2015 Posted March 24, 2015 Another approach is to write a find script, no triggers. Enter find mode Go to dedicated find layout, perhaps Go to object, the field you'd like cursor to be in Pause Then, on that layout is a button that resumes the script. Script continues... Perform find Trap for no found records Navigate to found set (list or form layout)
comment Posted March 24, 2015 Posted March 24, 2015 Once a user enters find mode I'd like the curser to select a certain field to enter the find data. Once data is entered and enter key is pressed I'd like to perform the find then scroll to the right of all the records to find the most current record everytime As Barbara said, this can all be done in a single script with a pause. No need to make it more complicated than that. Also, there's no such thing as "to the right of all the records", but if you tell your script to sort the found records (unnecessary if they are created in chronological order) and go to the last record, you will be at "the most current record".
Matthew R White Posted March 26, 2015 Author Posted March 26, 2015 Is there a way to separate or differentiate between when a user is performing a script or task verses a filemaker performing the script? With the above example, when I implement this script that is engaged (on entering find mode) when a user enters find mode the script works perfectly, however I also have multiple other scripts that enter this layout, enter find mode, etc etc that are all not working due to the (on entering find mode) script that applies it to everything. I'd like for this script to be performed only when a user enters find mode, not with any other filemaker scripts, make sense or?
Wim Decorte Posted March 26, 2015 Posted March 26, 2015 Your other scripts: use a different layout to do your finds, when the found set has been built, then take the user to the final layout.
bcooney Posted March 26, 2015 Posted March 26, 2015 Matthew, you may wish to step back from what may be the "over" use of Script Triggers. They do add complexity that you perhaps do not really need. Perhaps all you need is a simple Find script or a QuickFind. If you describe the use case, I can better recommend the technique. 1
Rick Whitelaw Posted March 26, 2015 Posted March 26, 2015 A script trigger set to fire on Mode Change will fire whether entering Find Mode via direct user input or via a script. As Barbara said, there has to be a better way of doing this. One thing I would recommend no matter how you proceed is to dispense with the script trigger. One of the downsides of all sorts of triggers is "once it's there it's there" and will cause certain results even after you've long forgotten it was even there in the first place. (Not the case in this situation).
Recommended Posts
This topic is 3586 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now