If the tables are related and you have auto enter calculations in the Schedule table you can you can do this with New Record.
No magic way I know of. You would need to set them individually, but you could reduce the script lines using a loop.
I'll note that questions about repeating fields tend to get replies saying that they're a bad idea anyway, but they can save us a lot of ridiculous repetition. FileMaker seems to fall way short of providing the vector operations repeating fields deserve.
One of the golden rules with FM is there is always more than one way to do anything. Repeating fields included.
There are a couple of ways to script this. Here is one idea.
Set Variable [$count +1]
Set Field [GetRepetition(Destination Field ;$count); GetRepetition(default field; $count)]
Exit Loop If [$count > 6]
Auto enter would be a separate issue, but I appreciate your confirmation that there's no one-liner way to assign all the values of one repeating field to another with the same number of reps.
"One of the golden rules with FM is there is always more than one way to do anything. Repeating fields included."
I thought there was also a golden rule that if something looks too clumsy and complicated in FileMaker then the problem is your ignorance of FileMaker. This seems to be an exception.
In 20 years I've yet to see an elegant FM way of dealing, for example, with multiple columns of accounting data from different time periods. Is there a way to do this? Yes. Is it elegant? No.
I know you can index a single repetition. I want to do all the repetitions at once. It would make sense for FM to do this when you don't specify the index.
Looping seems to be the best FM can offer currently. It might be an easy custom function to implement.
You can set multiple repetitions in a single script step using Import Records... specify that you want to keep repetitions in a single record.
Nope. A custom function cannot do it; a custom function is not a script.
STORE the data as individual related records. DISPLAY the data using repeating field or horizontal portal.
Often, the need to copy blocks of identical type data indicates a less than optimum design.
You can use lookup for the purpose. Something like
Set Field [ employeeID ; value ]
will lookup his schedule using relation, all repetition at once.
Yes, Auto-Enter Lookup will work perfectly. OP seemed to think
Auto-Enter was not a good idea.
This is a helpful thought, and I’ll see how far it gets me.
I also want to be able to do things like save the employee’s current week schedule as his/her new default.
I’m thinking my best approach might be to have default schedules in the same table as actual schedules. That way they can simply be duplicated, given a current date and if necessary be tagged as schedule rather than default. (And something like the reverse can be done to save a scheduled week as the new default.)
This would be a work-around. I’d still rather see SetField be able to assign more than one repetition at a time, something like
SetField ( Week Schedule::Hours[1..7]; Employee::Default Hours[1..7] )