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.

Showing ActivePortalRow outside of portal

Featured Replies

I have a portal that can be filtered. Outside of this portal on the same layout I have three fields:

Record Number,

Found Set, and

Total Records.

So far I can calculate the last two numbers but can not work out how to calculate the first.

Basically when a user clicks on a portal row I want the record number field to instantly display which record number in the found set is currently selected.

I do not want to do this by attaching a script to the portal row because there are already other buttons in the portal row (namely GTRR) attached to certain icons.

Does anyone know of a simple way to achieve this?

This is rather confusing. Record number, found set, and total records are all attributes of the LOCAL table (the one that the layout is based upon). A portal shows related records from another table. There is no such thing as a found set for a portal - a portal always shows all related records.

The equivalent of record number in a portal is the portal row number, which you can get by the Get(PortalRowNumber) function. However, I believe you WILL need use script to display the current portal row number in a field outside of the portal, because clicking in a portal will not cause a refresh of a calculation field based on Get(PortalRowNumber).

In the file where your portal is create a field with global scope. Make a relationship from this field to the record ID in the target file. Then, when the button is clicked in the portal stick the record ID of the highlighted record into that global. You can now put what fields you need onto the layout external to the portal and the information you asked for should show up,

Norman

Funny thing is I'm doing the exact thing on my app. My problem is that I want to use the "Go To Portal Row[select; Get(PortalRowNumber)] but it doesn't input the row number. If I leave "Perform without dialog" unchecked, it comes up with the dialog and the appropriate number of portal rows (0-9 for example), but how do I script it to set the number for the row clicked?

Go To Portal Row [ Select; Get(PortalRowNumber) ] tells Filemaker to go to the current portal row - i.e. to go where it already is. I'm not sure what you actually want to do, so I cannot offer an alternative.

Well I created a button out of 4 fields in the portal. The script does it's stuff fine, but at the end of it, I wanted to highlight the row, just like Go To PortalRow does. So filemaker should know at the time the user clicks the context of the row thats being clicked, but it always comes back with 0, so I assume it can't determine it.

Take a look at the attached screen shots. In Screen 1, you see the layout and under the "Detail Records" portion, there is a header label that says "Click a Product Detail..." This is the portal I'm referring to. Currently, when you click, I have a button that is the four middle fields and it's function is to populate the fields below related to that portal row. Works fine.

But in Screen 2, when you click the row, the scripts last step is to "Go To Portal Row (Select; Value:Get ( PortalRowNumber ) which when the "Perform without dialog" is unchecked shows a 0, which I assume means it can't find the associated portal to reference. If I manually enter a number within the portal rows range, it works.

Screen1.gif

Screen2.gif

When Get(PortalRowNumber) returns 0, it means you are no longer in a portal. I am guessing your script takes the focus elsewhere to do its job - so by the end of it Get(PortalRowNumber) is no longer relevant.

Try starting your script by storing the current portal row number in a variable. Then, at the end of the script use the variable to specify the row you want to go to and select.

I figured out the portal row number, for those that care. I need to set a variable at the beginning of the script for the current portal row number (the one that the focus was on) and then use that variable at the end to go to the appropriate record. For some reason when I did the selection at the end of the script, it lost it's reference, even though all the script did was set variables and fields.

I figured out the portal row number, for those that care.

:idunno:

So what, you don't like the way he copied/pasted your answer :

You just had it mixed up Michael, that's all, the good thing is he figured out :)

[kidding Rodd, kidding ]

So what, you don't like the way he copied/pasted your answer

It's more about the "for those that care" part.

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.