Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7302 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted

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.

Posted

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?

Posted

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.

This topic is 7302 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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