3 Replies Latest reply on Apr 17, 2012 6:33 AM by philmodjunk

    Go to Related Record Problem

    nashlopez

      Title

      Go to Related Record Problem

      Post

      Hi guys, new in Filemaker Pro 11 Advanced. I want to create a simple Enrollment System., I have 3 tables: Student, Enrollment and
      BSASubjects Table. I have joint table the Enrollment Table.

      Student Table

      pkStudent_ID

      Number

       Auto-enter Serial

      Stud_StudNumber

      Number

       

      Stud_Fullname

      Calculation

      First+Middle+Last

      Stud_Course

      Text

       

      Stud_Year

      Text

       

      Enrollment Table

      pkEnrollment

      Number

      Auto-enter Serial

      fkStudent_ID

      Number

       

      fkBSASubject_ID

      Number

       

      BSASubjects Table

      pkBSASubject_ID

      Number

      Auto-enter Serial

      fkStudent_ID

      Number

       

      Section

      Text

       

      Description

      Text

       

      Time

      Text

       

      Days

      Text

       

      Room

      Text

       

      Prof

      Text

       

      Relationships are: Student::pkStudent_ID = Enrollment::fkStudent_ID

                                 BSASubjects::pkBSASubject_ID = Enrollment::fkBSASubject_ID

      Allow creation of records in this table via this relationship on both fk ID are both enable/checked.

      I uploaded different subjects with section, description, time, unit/s, room etc in layout BSASubjectsFreeSection (listview) and show records from BSASubjects and it is ok. I created another layout, let say (BSAFREE Section) layout and show records from Enrollment which I understand this is a child table of BSASubjects table based on the relationships that I created.

      I made a button before those fields of BSASubjects table (pk and fk fields not included) so that this button will hold the script of selecting student subject/s and navigating respective layout.

      I want that when student click or select the button of that particular subject, I want to show that on the other layout (BSAFREE Section layout) as selected subjects, then go back to subjects selection window layout (BSASubjectsFreeSection) and select another subject/s and vice versa up to the maximum or allowed subject/s for that student.

      My problem is my script below, I can’t figure how and why there is no subject/s appeared on the other layout (BSAFREE Section layout)when I select or click the button of that particular subject from BSASubjectsFreeSection layout.

      Please help FM Masters

      My script:

      Go to Layout ["BSA FREE SELECTED SUBJECTS-FFS" (Enrollment)]

      Go to Related Record [From table: "Enrollment"; Using layout: "BSA FREE SELECTED SUBJECTS-FFS" (Enrollment)]

      New Record/Request

      ------------------------

      screen shot below:

       
        
        
        
        
        
        
        
        
        
        
        
       
       
       

       

      shoot.jpg

        • 1. Re: Go to Related Record Problem
          philmodjunk

          Remove the go to layout step and update your go to related records step to read:

          Go To Related Record [Show only related records; From table: Enrollment; Using layout: "BSA FREE SELECTED SUBJECTS-FFS" (Enrollment)]

          This pulls up all records in Enrollment that are related to the current record in BSASubjects. I there are no related records in Enrollment for the current record in BSASubjects, nothing happens. A more sophisticated script can check for related records and show a message to the user when this is the case. A conditional format on the button can also grey it out to make it look disabled.

          I'm not sure, though, that this is what you really want here. Are you trying to FIND records that already exist or CREATE records that do not yet exist? The above method works for finding existing records, but you need a different script for creating records.

          • 2. Re: Go to Related Record Problem
            nashlopez

            Phil I followed your instruction to remove the Go to layout step and update my Go to Related Records option: my Script look like this now - Go To Related Record [Show only related records; From table: BSASubjects; Using layout: "BSA FREE SELECTED SUBJECTS-FFS" (BSASubjects)] and when I click the GOTO button see picture above this will bring me to the BSA FREE SELECTED SUBJECTS-FFS layout but it pulls up all records or subjects from BSA-FreeSectionImportedSubjects-FFS layout under BSASubjects TABLE which that's not what I wanted to do.

            Here's the exact set up Phil, I have table BSASubjects and I have 2 layout for that table: 1. BSA-FreeSectionImportedSubjects-FFS layout where I imported records/subjects and 2. BSA FREE SELECTED SUBJECTS-FFS layout to see all selected subjects that I choose from BSA-FreeSectionImportedSubjects-FFS layout.

            What I wanted to do Phil for example is when I click o I select the GOTO 1 from BSA-FreeSectionImportedSubjects-FFS layout this current found set o subject will be the only record transported into another layout BSA FREE SELECTED SUBJECTS-FFS, then go back to BSA-FreeSectionImportedSubjects-FFS layout and select another record( let say GOTO 8 subject, then this will transported or add to the first record or subject in BSA FREE SELECTED SUBJECTS-FFS layout. (see screen shot above for your reference).

            All layout views as LIST VIEW Phil.

            Are you trying to FIND records that already exist? YES Phil because records or subjects in BSA-FreeSectionImportedSubjects-FFS layout are already imported, what they need to do is to select the subject/s or schedules they like to enroll.

            Phil it is possible? Another question is that LIST VIEW can handle this type of transaction? What if their is a pre-requisite on every subjects or that subject should only allow 50 students, is this possible Phil?

            • 3. Re: Go to Related Record Problem
              philmodjunk

              You aren't trying to find subjects. The two layouts, as I understand it, are based on two different tables.

              One layout, where you have your GoTo button, is based on subjects and the second (the layout specified in the GTRR step) is based on Enrollment. IF the GoTo button is to enroll the student, you'd need to use a different script that creates a new matching enrollment record--this creates an issue as your layout lists subjects and there's nothing in place that I can see that identifies the current student that is enrolling.

              There's nothing intrinsically wrong with using list view layouts, but they would require additional features for selecting the current student before going to a list of subjects from which to select and enroll in.

              I suggest you set up a portal to enrollment on your students layout for enrolling students in different subjects. This gives you the simplest most basic set up for working with a many to many relationship. Here's a demo file that illustrates this set up and then demonstrates several more sophisticated layout options that also work: http://www.4shared.com/file/dZ0bjclw/ManyToManywDemoWExtras.html

              What if their is a pre-requisite on every subjects or that subject should only allow 50 students

              You'll want to get the basic layout setups working first. It's very possible that you will need more tables than you currently have to manage enrollment--such as if the same subject can be taught in more than one time period in your class schedule.