May 12, 200817 yr 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
May 12, 200817 yr 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
May 12, 200817 yr 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
May 12, 200817 yr 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
May 19, 200817 yr 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