Jump to content

Always On Script?


This topic is 2810 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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).

Link to comment
Share on other sites

This topic is 2810 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.