Looping with script to create records in a table based on looked up criteria in a source table?
I'm having to rework part of database so while I'm at it I thought it would be nice to have some features that I've never figured out how to do in FileMaker.
A simplified version of what I would like is a script that will; For every record in TableA that has an indexed Field1 = 123 AND Field2 ="xyz" AND Field3 > 0 create a record in TableB with indexed Field1=TableA::Field2 AND Field2 = to a running total of TableA::Field3 AND Field3= TableA::Field4
TableA::Field1 is a key field from a lineitem table
TableA::Field2 is text that designates a function that is in another table that is used to define the function and the rate for it that is used as a values list for data entry and is not static, meaning new functions are added as needed on the fly during data entry.
TableA::Field3 is a numerical value, usually time
TableA::Field4 is an indexed field that relates back to record in a different table that this is a line item of
I had originally thought I should be able to do this with a summary field but never figured out how to make it work right so I thought maybe a script should be the way to go that I could trigger appropriately.
Any Ideas? Pointers? Examples?