Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

portal row number outside of portal?


This topic is 6560 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

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
Posted

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.

Posted (edited)

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
Posted

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.

Posted

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!

Posted

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

This topic is 6560 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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