Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Portal row button to pass data

Featured Replies

Hello,

I'd like to send a selected portal row's data to a field on another layout.

Schema:

2 layouts ; 2 windows.

Relationships:

Table:Department

Field:"Department"

linked to:

Table:Course

on field: "Department"

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

Table:Student

field:"special rec"

linked to:

Table:Course

on field:"CourseID"

The field "special rec" in the Student table is empty and waiting to be filled by a selected course.

On the student layout, a button is clicked to pull up a window containing a layout which displays the departments with their respective courses in a portal. I then want to choose one of those courses in the portal and send the data to the "special rec" field on the Student layout. Any ideas? Thanks! Jonathan

You could use a script parameter for the desired data on the button which selects the course (just use PortalRelationship::Field as your parameter). Then the script can close the window or select the original one and then Set Field [student::special rec; Get(ScriptParameter)].

It is often that the relationship between course and student table is many to many. One student can join multiple courses and one course can be joined by multiple students. Hence I would advise you to keep a separate table studentcourse to store the student and course details.

  • Author

Thank you, I feel like I'm getting somewhere. But I have a follow up question. I'm trying to build a script that will populate the two foreign key fields of the middle table (StudentCourse). So far it's creating a new record, but the data isn't showing up. I want the script to populate the StudentID from the Student table and the CourseID from the course table. On pages 456 and 457 in the book, "Special Edition Using Filemaker 7" by Lane, Bowers, Love, and Moyer there seems to be an example modeling what I'm trying to do. However, I think my problem is knowing how to refer to the various windows and layouts that are involved during the script. The studentID that I need is on the origional layout before I press a button to pop up a window containing the selection portal of courses. - Jonathan

Edited by Guest

Why not create the record directly in studentcourse table instead of creating record in another table and running the script to populate foreign key values in the new record?

I don't know about your solution but usually in a school database which I would design, I would give a layout from a table to enter a new student information, another layout from another table to enter the course information and would have a layout from studentcourse table. I would have a portal row to show all the courses a student is attending. When an existing student comes to me, I would search his name in the studentcourse table which would show me all the courses he has applied to. If he wants to appear in anyother course, I would select the last row of the portal and select the course. In the portal, the field course would be a pop-up list based on the course field in course table.

If you want to do it with the script, can you write to me where the data isn't showing?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.