March 23, 200421 yr 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
March 23, 200421 yr 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?
March 23, 200421 yr Author 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?
March 23, 200421 yr 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.
October 1, 200421 yr Author 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
October 1, 200421 yr 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?
October 4, 200421 yr Author 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.)
Create an account or sign in to comment