How do I set up a field that tells me how many records are in a portal?
I use FMP 9 on a MAC. How do I set up a field to show me how many records are in a portal?
Count(PortalOccurrenceName :: PortalFieldName)
Leave field on outside of portal
I am not sure what you meant by PortalOccurenceName? I thought you meant object name so I named the portal and then defined the field calculation as follows:
LayoutObjectNames ( "Forum Email Campaign Management" ; "Recipients" ) & Count (campaigns_campaigncontacts_contacts :: Contact ID )
This worked. However, if I misunderstood you and ended up doing it a different way would please let me know so I can learn what I did wrong. Thank you for your help.
campaigns_campaigncontacts_contacts is your "PortalOccurrenceName" and Contact ID is your "PortalFieldName".
Thus you could simplify your calculation to just:
Count (campaigns_campaigncontacts_contacts :: Contact ID )
I have Count(policies:: policy_no) on my portal but cannot see the value displayed, even though the text is formatted as Blue on pale yellow.
Whilst attempting to debg, the data Viewer correctly shows the number of policies for the cust as User moves from one cust record to another, but no value is displayed in the PolicyCount filed on the portal ( this field is set as auto-enter, specified as Count(policy_no) with "do not replace..." deselected.
What am I doing wrong?
HugoLidia wrote: this field is set as auto-enterUse a calculation field.
this field is set as auto-enter
Use a calculation field.
It sounds like this field is in the Poicies table. The number of policies a customer has is an attribute of customer - so this field needs to be defined in the Customers table. Assuming the relationship is:
Customers::CustomerID = Policies::CustomerID
define the field as =
Count ( Policies::CustomerID )
Absolutely right - I hadn't rrealised I had defined it correctly in the debugger/data viewer, but incorrectly in the layout.
Thanks for putting me right.
Retrieving data ...