Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Same Q as below - Copy records to another table

Featured Replies

I have 3 related tables. Training Log, Athletes, Athlete Log. Training Log and Athletes have a relationship based on a Coach ID. Training Log and Athlete Log are related through a Training ID. I want to copy all of the related Athletes and create 'New Records' in the Athlete Log.

I have global items for Coach ID and Training ID. I have been trying to loop through the Athletes without luck. Is this the correct way?

Thanks.

Whenever you want to transfer one set of records to another table, especially if there are a lot, Import records is usually the fastest most straightforward path.

If the Athlete Log and the Training Log are tied by the primary ID of Training Log, Training ID, then you're likely going to be importing from Training Log to Athlete Log. You could also do it from Athletes, but you'd have to then Lookup the Training ID, via the Athlete to Training Log relationship, into the Athlete Log.

We don't know however whether you have multiple records per athlete in Training Log, or none, or what it really is.

So, it could be done from either Athlete or Training Log, depending on which was more convenient. If you want 1 Athlete Log record per Athlete, irregardless of whether they'd have Training Log record, then obviously you have to do it from Athletes.

IMHO, this would probably be unnecessary, since you could just as easily create the Athlete Log records directly from Athlete, when you needed one (or more?).

I don't much like "create a bunch of records in case I might need them" routines. It is seldom needed, and is a poor substitute for adaquate routines to create and edit data. Create one "when and as" you need it.

But creating a bunch of records of tasks that should be done from another "template" table is a legitimate reason to do "batch" creation. Because the records are needed, if only to easily show that something wasn't done. It depends.

  • Author

What does IMHO stand for?

Yes, I need to show that something was or wasn't done per athlete associated with each training record. I figure the process would be as such; A new training record is created and a coach selected. There would be a button (unless there is a easier way) to get all athletes assigned to that coach. The athlete IDs would be copied to the Athlete log along with the coach ID and training ID. The athlete log is shown in a portal on a duplicate layout of the training log. From here the person could enter specific information via GTRR for each athlete. Athletes without any information could then be listed on the training report as 'no-shows'.

As my brain thinks, I need to get the coach ID, go to the athlete record, find all athletes assigned to that coach and copy the athlete, coach and training IDs to and new set of records in the athlete log.

Does that make sense?

To create the Athlete Logs, go to the Coach, then Go to Related Athletes (who are assigned to that coach) showing only related. Then import this found set into the Athlete Log.

IMHO, "In my humble opinion"

We're assuming that each Coach only has 1 training template; and that it has many training thingees (activitities, whatever).

If a Coach has more than 1 Training Template, then that's another table (kind of like an Invoice and its line items).

If each coach has more than 1 training template, then you've got to know which for each of his athletes (and that's another join table).

I'm not trying to cause trouble (INTTCT :-), but short questions may or may not conceal entire tables.

  • Author

The latter is true in this case.

A new Training template is created for each day. In the training template, the Coach is selected. The coach ID creates the relationship between Training and Athlete. It's through this relationship that I want to copy the related Athlete IDs into the Athlete Log along with the Training ID. The newly created data is then shown in the Athlete log portal on the training page using a training ID relationship.

In my button script I currently Set Fields for a global training ID and coach ID. I just can't figure out how to go copy and insert the items. In SQL I would query the data and loop the insert. It must be something similar right?

Attached is an example of what I described above. Go to the Training Log tab, then click the Create Logs button in the Skier Logs section.

DPSEF_11-24a.fp7.zip

  • Author

That's it! I kept looking at import as you suggested, but the file thing threw me. It never occurred to me that it could import into itself.

yay.gif Thanks a ton.

  • Author

Can the import be accomplish with a runtime file? I keep getting a file not found error.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.