Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

How to create thousands of new records in a related table


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

Recommended Posts

Posted

I have a new PROJECT table which is related to

the main table with the main ID. I plan to use the

Project table to keep track of all actions for

each project. In the main table, a found set of

2000 people are assigned to ProjectA. How can I

create the 2000 records in the project table and

put them in ProjectA?

Thanks for any help!

-Sal

Posted

You should at least have 3 tables.

Project

People

ProjectPeople

ProjectPeople should be a join table that stores the IDs for each Project and Person.

So if you have project # 4, it would look something like:

ProjID PersonID

4 15

4 22

4 55

Posted

Thank you John for your suggestion. However, I

still don't understand how the third table would

help. This Project table is similar to all other

tables I have in the database, they are linked with each person's ID. I could have a portal in

the main table layout, manually enter the project

name and other data into each person's project

portal. But I'm looking for a way (or a script)

to do that automatically for 2000 records. I'm

trying a script to create new records in Project

table for each person in the found set. So far I

couldn't figure how to loop through the found

set. Any further help would be greatly appreciated.

-Sal

Posted

I still do not undertand your structure, but you can create another relationship to a new TO with a multi-predicate join keyed on pk_PersonID to fk_PersonID and gProjectID to fk_ProjectID. The relationship should have "Allow creation of records" checked on the child side.

gProjectID would be a global field which is set to the project ID that you want to add everyone to. Then with a simple Loop of a set field, you should be able to create records for the found set.

Loop

Set Field [ NewTO::fk_ProjectID; gProjectID ]

Go to Record [Next; Exit after last]

End Loop

This topic is 6089 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.