Morley Chalmers Posted September 24, 2008 Posted September 24, 2008 I would like to make a button appear if the current count of records in a portal is more than 1, disappear if 1 or zero. In FMP6 I used the trick of a one record portal that displayed that record if the relationship was satisfied. That solution always felt quite clutzy, but it worked. In FMP9 I can hide the button under certain conditions by making the text and fill of the button match the background. However the button will still flash when that area is clicked. So this solution isn't ideal. Is there a better way? In a related issue, I've worked out a way to obtain the displayed count of a portal. It works, but it also feels clutzy. Is there a better way. Here's the clutzy way (that works). Add a Constant to the table displayed in the portal, in this case the Addresses table. In the table of the layout at hand (in this case People) add a calc which takes the sum of that Constant. The context of the calc is People and calculation itself is Sum (portalRelationshipName::Constant). A rather convoluted way of doing this. I'd like to learn how to do this properly. Much appreciated.
Josh Ormond Posted September 24, 2008 Posted September 24, 2008 The portal method is still a good option...probably the best with the current feature set. Other options: 1. Alternate layouts. 2. Multiple Tabs, with various buttons.
comment Posted September 24, 2008 Posted September 24, 2008 A simple way to count related records is: Count ( RelatedTable::Matchfield )
Morley Chalmers Posted September 24, 2008 Author Posted September 24, 2008 Am mildly started that the one record portal is still the way to go when hiding objects. And thanks for the Count(portalRelationship::matchfield). Much simpler, and it works. Much appreciation to both of you.
Recommended Posts
This topic is 5904 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