Jump to content

Can you trigger a script by changing a fieldentry?


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

Recommended Posts

I know you can trigger a ScriptMaker script by defining it so it appears in your Script menu, or by tying it into a button, but are there other ways of triggering scripts? In particular I'd like to run a script that affects various fields in an entry whenever any of those entries has been modified. There must be a way to make it run by perhaps linking it to a modification date, but I can't see it.

And if that's not possible, is there a way to run a maintenance script upon opening or closing that will perform itself on each and every entry in the database?

I'm running FM 3.1 on mac OS 9.2.2 but will soon be upgrading to FM 6.1.

Please let me know if I'm not being clear; I'll try to explain it a bit better. And thanks.

Version: v3.x

Platform: Mac OS 9

Link to comment
Share on other sites

Scripts cannot be triggered by data input, a feature we'd all like to see added to FM.

There's a preference (Document, not Application) to run a script when opening a file. In this script, use this basic loop:

Show All Records

Go to Record/Request/Page [First]

Loop

--- do your thing here

Exit Loop If ["Status (CurrentRecordNumber) = Status (CurrentRecordCount)"]

Go to Record/Request/Page [Next]

End Loop

Could calculation fields do this instead of a script?

Link to comment
Share on other sites

Can calculation fields directly change the values of any other fields besides their own?

No, but lookups based on other fields changing can. It all depends on your structure as to whether it will be a doable or relatively easy task.

Link to comment
Share on other sites

  • 6 months later...

Sure -- this is the script, and it's pretty much the same as suggested above:

Go to Layout ["Main Layout"]

Enter Browse Mode []

Show All Records

Go to Record/Request/Page [First]

Loop

Perform Script ["trim text fields"]

Perform Script ["autofill region code"]

Exit Loop If ["Status (CurrentRecordNumber) = Status (CurrentRecordCount)"]

Go to Record/Request/Page [Next]

End Loop

The two scripts it calls are pretty basic and work otherwise, so I'm guess the problem isn't there.

(The budget for this thing isn't great, so I'm trying to avoid paying for a solution to it.)

Link to comment
Share on other sites

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