I have a script trigger that works fine on the active record... how do I make it activate all the records in a found set?
What do you mean by "activate"?
What trigger are you using?
We do not charge by the word, feel free to explain what you want in much more detail.
There is only one active record (per window). So you cannot activate all of them at once. Did you mean something different and want to run your script on all of them?
Yes, I want the script to activate on all records in a found set. For example... I have a script that takes text ( calculated values ) from one field and copies that text into another field ( text field ) in the record. Preferably, I would like a script that, anytime the calculated field changes in any record, automatically copies and pastes that text into the text field of that record.
I tried making it work by using a script trigger for OnLayoutEnter, but that only worked for the active record. I need it to happen on every record, anytime that record's calculated value changes.
I hope that explains it better.
Thanks for getting back to me... I hope my comment above explains it better.
Hmmm... maybe I'm approaching this wrong... perhaps shouldn't be trying to use a script trigger? Maybe should be adding a 'execute my script' at the end of my calculation? Just thought of that approach... don't know if I know how to do that but wanted to throw this out there in case I should be looking at this idea instead?
I can't make sense of what you are describing.
Please spell out exactly what you are doing and, very important, why you want to do this. Often, copying data like this from one record to another is not even necessary in a relational database system such as FileMaker. Often, you can simply access the data via the relationship.
If you want to execute some scriptsteps over the whole foundset the pattern is
Goto Record (First)
// do your steps here
Goto Record (Next; exit after last)
You have to be careful executing this by scripttrigger. Especially OnRecordEnter will trigger the script over and over. But OnLayoutEnter should be ok.
Thanks... great solution. Actually, it will probably help with another thing as well... I think this will work and appreciate the heads up about OnRecordEnter.
A calculation field may also be a fit for the purpose.
Retrieving data ...