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.

Featured Replies

Each record in my portal row has a variable of 1.

I have a script that first checks to see if I am on the last portal row:

Sum ( relationship::var )= Get ( PortalRowNumber )

Unfortunatly this no longer works in FMP8. If the portal is active (a row is selected) the Sum function returns a '?'.

So how can I do a quick test to see it the row selected is the last in the relationship?

Hi

I kept this thread as an alias on my desktop, because it contains stuff that makes me wonder. First off must some of the peculiarities be solved. Is it so that what you call a variable actually is a constant??? Why do you exploit Sum( instead of Count( on the ForeingKey???

I did also consider why you need this establishing of fact at all?? It seems like it's a portal without scrollbar, so you wish to know if it's the last record related to or more following are invisible.

Then to the problem, i guess that you inspect each part of the equation in dataviewer and it's there you see the "?" ...the explanation should probably be found in the change of the ownership of the record introduced with fm7 ...this means that if you go to a records portal row will you not be the owner of the main record, and the aggregate function has no focus even if you do it like this:

Set Variable [ $pling; Value:Count ( thePortal::ForeingKey ) ] 

If [ Get ( PortalRowNumber ) = $pling ] 

     Show Custom Dialog [ Message: "This is the last portalRow"; Buttons: “OK” ] 

End If 




The only way the variable can recieve a value is to click outside the portals, that defeat the entire object.



The way you can make it work is to use a field in the the main record that contains the aggregation calc in an unstored field ...why this works must be due to the bidirectivity the relations now exhibit.




Set Variable [ $pling; Value:test::Howmany ] 

If [ Get ( PortalRowNumber ) = $pling ] 

      Show Custom Dialog [ Message: "This is the last portalRow"; Buttons: “OK” ] 

End If 

Where the test::Howmany is the newly defined aggregation field.

--sd

Edited by Guest

If you pass the portal row number as a parameter, you can exit the portal, do your check, then go back to the portal row. Pretty convoluted, but at least it will work in version 7 as well.

I am equally puzzled regarding the need for this.

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.