Jump to content

To trigger a script or button from a field entry?


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

Recommended Posts

I just saw a demo of this today in FM7. However, it's done with a plug-in which i don't believe they are shipping yet as there are some issues. There is also an available plug-in called ScriptIt from Comm-Unity Networking Systems that can do this.

Something to think about, however: Lets say the script you want to trigger simply multiplies the value of FIELD1 by 2. So you enter "10" into FIELD1, then scroll to the next record, thus triggering the script (by exiting the field). Which record is this script going to be performed on? Probably record 2, which is not necessarily what you want. Just an issue to keep in mind, from someone who would DESPARATELY love to have this feature available natively in FM.

Jerry

Link to comment
Share on other sites

thanks Jerry for the info. Nice to know that FM7 might be doing something about it - I've been hankering for it for YEARS!

I didn't know that plug-in - had a look and as it does other things as well it might be worth it.

cheers

Michael

Link to comment
Share on other sites

...wondering if there were any advancements in FM7.

In many cases, the scripts we wish to execute revolve around setting the contents of that (or another) field with a calculated result from an If[] statement. FM7's new ability to modify the direct data as if it were an unstored calculation has actually decreased my number of scripts (and shortened many that remain), as well as reduced my required calculations - particularly unstored ones. A simple number field containing a 1 is a good example.

Instead of trying to trigger a script when leaving an AmountPaid field to see if an Invoice is paid in full (or setting another field with a 1), I have a standard number field called Unpaid with Auto-enter calculation of:

(AmountDue > AmountPaid)

This enters a 1 if debt is still outstanding and it updates whenever data is changed in either field. It eliminates dealing with empty fields, summing, unstored calculations or scripting finds that use an If[] calculation. Then a simple Find on that Indexed 1 quickly produces my outstanding Invoices. And my relationship to Credit (only unpaid) table is also instant. Many of my old scripts were setting fields that would not automatically update.

As far as I know, you still need a plugin to trigger upon field exit, but you will find you need it much less often than with prior versions. Just remember to unclick "Do not replace existing value for field ..." right under the Auto-enter by calculation.

Link to comment
Share on other sites

  • 3 weeks later...

thanks Moonshadow for all that. Yes, I can see the huge leap with that new FM7 change - even though I rarely deal with financial stuff, it would apply in all sorts of situations.... in fact as I think about it I can see the scripts shrinking and disappearing in my mind....

But in fact my need is more in the area of navigation than calculation - so I guess I investigate the plug-in solutions.

thanks again

Link to comment
Share on other sites

I recently posted about the Example.plugin that comes with FileMaker Developer (which I have). It is available to all at http://www.databasepros.com, Resources, Tips, "New" button. There is a clearly labeled example file that shows that this plug-in can run a script (by name) on field exit.

One wonders if FileMaker would sanction this, but this is John Mark Osborne's site. He's one of the best certified FileMaker trainers around, co-author of "Scriptology," etc., so one assumes it's with their permission.

Link to comment
Share on other sites

  • 3 weeks later...

This topic is 7119 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
×
×
  • Create New...

Important Information

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