Write a script that loops through your student records, creating one related record for each student record. The details of that will depend on the relationship you have created for the portal.
Writting a loop is what I need help with. I have no idea how that would be accomplished. I have one DB that has all the student info, and one DB that is the grade book (it has two tables - the Assigment table and the grade table). The portal is in the assignment and is linking to the grade table. When I create a assignment i need the portal to create records in grades table with the student names populated.
Sounds like you need these relationships:
Assignments::__pkAssignmentID = Grades::_fkAssignmentID
Students::__pkStudentID = Grades::_fkStudentID
And this would NOT place a student name in the Grades records. Student names are not unique and might change on you. (Even grade school aged children undergo legal name changes such as a step parent adoption.) But you will be able to show the student name in this portal by adding the student name field(s) from Students to the portal row.
For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained
That would enable a looping script like this to assign a given assignment to all records in the Students table:
#Perform script from an Assignments layout
Set Variable [$SAssignID ; value: Assignments::__pkAssignmentID ]
Go to Layout ["Students" (Students) ]
Show All Records--->this will need to be changed if you only want to assign some students instead of all students
Go to Record/Request/Page [First]
Set Variable [$StudentID ; value: Students::__pkStudentID]
Go to Layout ["Assignments" (Assignments)]
Set Field [Assignments::_fkAssignID ; $AssignID]
Set Field [Assignments::_fkStudentID ; $StudentID]
Go to Layout ["Students" (Students)]
Go to Record/Request/Page [Next ; Exit after last ]
Go to Layout [original layout]
Good idea on basing info on StudentID and not name, I hadn't thought of that. I will give this a try
Well, It works for the first two records, and then it loops on the 2nd record until i escape the loop. Im not sure why that is but thank you for the help getting me this far!
OK, I found my error. I am wanting to only have records created for "Active" students. Once I added Show All Records it worked just fine. I just need to work out the only "Active" Students portion.
In place of Show All Records, perform a find for only the student records that you want.