Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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?

Posted

Hi Sam,

Actually that script might be just as good, thanks very much.

I've been trying to think of how to get the calculation field to do it, but it's no use. Can calculation fields directly change the values of any other fields besides their own?

Posted

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.

  • 6 months later...
Posted

OK this one reeeeeally late reply to CyborgSam, but I tried the script you mentioned: it looks fine, but when I run it, it only affects the first record and that's it.

Any ideas why? Thanks

Posted

Do you have the Go to Record/Request/Page [Next] step in it? Can you post your script so we can see what the problem may be?

Posted

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

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