Jump 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.

How to create thousands of new records in a related table

Featured Replies

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

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

  • Author

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

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

  • Author

Thanks John. It works the way you suggested. I also tried with export and import, that works as well.

-Sal

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.