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 number outside of portal?

Featured Replies

Thanks in advance for your help!

I have a field in my layout header that successfully counts the total number of rows in my portal, and arrow buttons that move the cursor through the rows (using the script go to portal row next, etc.).

It looks something like this: << < Record x of z > >>

What I want to be able to do is add the current record number, i.e. the "x".

I have defined a portal row field = Get (PortalRowNumber), but I cannot get it to work, even if I have the portal rows numbered inside the portal using @@. I have tried using @@ in the header but it also doesn't work.

I want to keep the counts and arrows in my header and not within the portal -- is this possible?

Edited by Guest

In your script for going to the next record, add a step that sets a global field to the portal row. Then reference that field for your header info.

Set up a calculation field with this calc:

Let([

Fc = Get(FoundCount);

Tc =Get ( RecordNumber )];

"Viewing " & Tc & " of " & Fc) &

" records."

Place the field ( as a merge field) where you want it. Your output will be:

Viewing 28 of 250 records.

When you go to the next record up or down, or any record within the found set, you will get viewing 27 of 250 records (If you go down one) etc.

Of course you need to place this calc in the table you wish to get the input from.

HTH

Al

Edited by Guest

I'm afraid this is wrong.

Let([

Fc = Get(FoundCount);

Tc =Get ( RecordNumber )];

"Viewing " & Tc & " of " & Fc) &

" records."

Get(FoundCount) will return the the number of records in the current found set and Get ( RecordNumber ) will give you the current record number of the current found set; it has nothing to do with the number of related records or which portal row is it.

  • Author

Thank you for your quick reply!

I have tried your suggestion but I am fairly new to FMP8 and unfortunately don't really know how to use global fields so I didn't get very far...

Is the "x" record count field supposed to be the global field, or a separate one that calls the global?

Could you be a bit more specific in how I should set up the script?

Thank you so much for your help!

You can create a global field by just changing the storage option for global. The global field is not dependent on the current record.

Then you can reference that field as a merge field in your header. Something like <>

I stand corrected.

  • Author

Thank you muchly!

Finally got everything working the way I want... My header now contains correct counts for first, last, previous, next, and total portal row!

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.