Skip 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.

Layout Name by Calculation

Featured Replies

So I'm trying to navigate between records to the appropriate layout. In my database I have different forms that students need to take and fill out. Which forms the students need to take is dependent on which classes they are in. So I have a Student table, a Enrollment table which relates which classes have which students and vice-versa, the Course table, and then the Forms Assignment table which only has two fields (course id and form name). The last table in my database is linked directly to the student and is the Forms table. This table contains all of the different forms a student can take and displays the different forms by using different layouts. From the student table/layout I have setup a portal that shows me the related records from the form assignment table using the form name field. This portal is working properly and displaying the correct form names. Now I want to put a link inside the row in the portal displaying the form name. I've assigned a button "Go to Related Record" with Get related record from the Forms table, but then I want to show the record using layout name by calculation. This is where I'm having problems. I don't understand what parameters filemaker is really wanting from me in the calculation. If I'm able to somehow grab the contents of the names in the form assignment table then I think this will be possible, but like I was saying I hardly know how to script anything in Filemaker. I'm very new to Filemaker and would really appreciate any suggestions!

I would add FormID to the Forms table, and not use the form name in any relationship.

Layout by Calculation is attractive, but it requires a strict layout naming convention. So, form_1 would be the layout name for, um, Form1. You could Go to Layout by Calc ( "form_" & FormID). See how that'll break if you change the layout name?

I prefer a nav script that allows me to rename my layouts and not break anything.

User clicks portal row:

nav to Form (scriptparameter set to the FormID)

GTRR from portalTO::FormID to Forms by FormID

If ( get (scriptparameter) = 1)

Go to Layout (Form1)

ElseIf (get (scriptparameter) = 2)

Go to Layout ( Form2)

ElseIf

(an elseif per form layout)

End If

hth,

Barbara

  • Author

Thanks for the reply.

The concept I'm having problems understanding is how am I supposed to appropriately assign the scriptparameter to the formID?

I'm guessing I would need to do this by a calculation associated with the get(PortalRowNumber) fx. But my problem here is that in the Forms Assignment table I have multiple classes assigned to an individual form.

For example inside my Forms Assignment table I have three records. The three records assign form1 and form2 to class1 and form1 to class2. If I am using the get(PortalRowNumber) to reference the record number of the related record in the Forms Assign table then I would be receiving one when I needed three since the assignment for form1 to class2 is in the third record.

So in summary I'm still falling short on how to appropriately reference directly to the correct related record that is displayed in the portal.

Thanks,

Brandon

  • Author

So I created a simple solution with your help and researching the topic a bit more.

Set Variable [$layoutID: GetNthRecord ( Form Assignment::( LayoutID; get ( PortalRowNumber ) )]

Go to Related Record[From Table: "Forms"; Using layout:$layoutID]

Thank you so much for your help, it really helped me understand the concepts better!

Brandon

I'm sorry, I missed some days on here and didn't see your reply. To set the parameter, you would specify it in the Button Setup dialog. When you make a button, and set it to Perform Script, you will get a Specify Script dialog. In that dialog, you'll see at the bottom the ability to define a script parameter (and access to the calculation engine). I was suggesting that you simply pass the FormID to the script, and then navigate to the layout you need based on the FormID.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.