rivet Posted November 13, 2005 Posted November 13, 2005 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?
Søren Dyhr Posted November 15, 2005 Posted November 15, 2005 (edited) 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 November 15, 2005 by Guest
comment Posted November 15, 2005 Posted November 15, 2005 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.
Recommended Posts
This topic is 6951 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 accountSign in
Already have an account? Sign in here.
Sign In Now