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

Showing ActivePortalRow outside of portal


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

Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted

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?

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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 ]

This topic is 6246 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.