Exporting the related records of each teacher, one teacher at a time, one document

Discussion created by jbrown Expert on Apr 20, 2012
Latest reply on Apr 23, 2012 by jbrown

Hey all,

How would I go about exporting related records of a record in a cyclic fashion?

I have a table of teachers. Each teacher is related to student records based on school and grade. I want to export the records as pictured below:

Teacher A: Student A

Teacher A: Student B

Teacher A: Student C

Teacher B: Student A

Teacher B: Student B

Teacher B: Student C


Each teacher has 100 students or so, so in excel, teacher A would have 100 lines.

I want them to be in one file.

But I'm not sure how to set up the script:

Go to Layout: Teachers

Find "Teachers'

Go to first record

Export all of teacher A's students in the manner described

Go to the next teacher

Export all of teacher B's students in the manner described.


Is there a way to do this?