Jump to content

plugin help


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

Recommended Posts

Hello VICH! I'm the creator of EventScript and I know my examples are a bit too complex. :( Therefore, here is some general advices that hopefully, will be able to demonstrate you the bases to use this plug-in.

First, EventScript cannot be used thru IWP or CWP! This is only for the Pro, Developer, Kiosk and Runtime distributions. It is built natively for FMPro version 7 and above (it may work under FMPro 8 but actually, I don't know if this is fully compatible with the upcoming version of FMPro)

In the future, I wish EventScript can resides on a FMServer hard disk and be executed server-side on the server's cpu(s). But currently, you have to install the PI on every workstation that should use his functionalities.

About the master demo-file:

There is a button on the top of every layouts for the "EventScript samples" file. Click on the "Re-Login Admin" button and then, you'll get a master access to the whole structure. There's many open examples in this sample file.

The login/password for this file is admin/admin.

Basic tips about implementing Events-trigger on a text, a number, a date, a time, a timestamp or a container field:

The simplest way to place an "after-update" event in FileMaker Pro 7 is to go under the "Define Database" menu, then choose your table, then double-click the field on which you want to add an after-update trigger, set an "Auto-Enter" option with "Calculated Value". For a trigger happening from a field called "QuantityOrdered", your calculation should looks like :

QuantityOrdered & S4HU_EventScript( Get ( FileName ) ; "TheExactNameOfYourTargetScript" ; "" )

The "QuantityOrdered" in this calc is required in "Auto-enter" option because FileMaker is waiting to make an auto-enter in the watched field as soon as the user will quit the field. So, you must tell to FMPro to place the actual content of the field (itself) and then, also launch the script by the same occasion. Think of this auto-enter functionality as a kind of automatic built-in "Set Field" script step.

Do not forget to remove the "Do not replace existing value of field (if any)" checkbox under the "Calculated value" option and then, give it a test. You will get your script to be launched each time a user will update the content of this field. If you don't place any additional conditions about privileges set, then all users will have the same "trigger behaviour".

Usually, this is not a good idea to place EventScript directly into a pure calculation field. Because FileMaker will re-calculate your calc each time your record will be browsed then, the script will be triggered too often. Don't forget that is an action-reaction behavior...

Another good solution is to place the triggering calculation inside the "Validation Tab" for the watched field. The "Validated by calculation" can be a very good place to put your EventScript invocation. It will trigger the script when the user will exit the validated field, even if the user is trying to browse to another record, table or layout. (See our "On Dirty" demo on the master file for more infos.)

Here's an example of a simple validation calc :

1 & S4HU_EventScript( Get ( FileName ) ; "TheExactNameOfYourTargetScript" ; "" )

The 1 is required. It tell to FMpro that the validation rules are ok. We are only using the validation event to place the EventScript's call, we are not really validating at this stage. See the idea!? :)

For "before update" events, it's about the same matter but inside a custom privileges set... It is a bit more complex but there's an example in the sample file.

Remember, any calculation boxes can be used to trigger a script.

GEE! I'm almost done! :o)

Here is a small summary of the four (4) stages that are proposed in our example file when implementing more complicated EventScript's triggers.

1. Choose the moment you want to get your action to be triggered.

2. Go in the corresponding calculation box for this moment(called "event") and add the EventScript function.

3. In option, if the calc is re-calculated too often and/or if you want to fine-tune "the event", then you can add some additional IFs or CASEs statements to make the script to be launched only under more specific conditions.

4. In option, you can add some other secondary processes as for example, managing by the same time a "console-module" as found into our demo file. These processes are "parallel-executed" but totally optional.

I really hope that helps!??

Link to comment
Share on other sites

And I have no idea as to WHY to use it, isn't the need for triggers by and large provided for by native validations, data/relations structures, custom functions and calc'fields???

Slightly provoking could I say, that flaws in relational structure makes tools like yours be in demand.

--sd

Link to comment
Share on other sites

This topic is 6867 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.