2 Replies Latest reply on Aug 3, 2010 11:37 AM by buck_5648798798

    A script to add all records to a portal

    buck_5648798798

      Title

      A script to add all records to a portal

      Post

      Hi. With a great deal of help from this forum, I'm making a database to track class attendance.

      I have a layout for the class with a portal to list all of the students in that class. I have a script to add students to the portal one by one. I would like to create an "Add All" button that adds all of the students in one shot. I need help with writing a script that gathers all of the student names from one table and creates a record for each in another table.

      Thanks

        • 1. Re: A script to add all records to a portal
          philmodjunk

          Freeze window
          #Get the value you need so that you can link the new records correctly to the parent record.
          Set Variable [$ParentID ; Value: ParentTable::IDfield ]
          Go To Layout [Students (Student Table ) ]
          Show All records // or perform a find if you don't want all the records
          Go To Record [first]
          Loop
            Set Variable [$StudentID ; Value: Students::StudentID]
            Go To Layout [ PortalTable ]
            New Record/Request
            Set Field [PortalTable::ParentID ; $ParentID ]
            Set FIeld [PortalTable::StudentID; $StudentID ]
            Go To Layout [ Students ]
            Go To Record [ exit after last ; next ]
          End Loop
          Go To Layout [original layout]

          • 2. Re: A script to add all records to a portal
            buck_5648798798

            Thanks! Besides being a great help now, I think this technique will help with the other really important script that I need for my database. The one that adds all students to each date selected by the user...