Jump to content

HOW TO: Lookup Portal Record Count

Recommended Posts

I was looking for an easy way to get a record count of a portal and couldn't see how to do it anywhere.
Luckily I found a workaround to do it and thought I'd share.

  1. Select Insert | Other Symbol.
  2. Select FoundCount.
  3. Move the new merge field into a portal row.
  4. Hide the merge field by setting 'Hide object when' to True.
  5. Give the merge field a name, for example 'PortalCount'.

Now you can use the following calculation to find the total row count for the portal:

GetLayoutObjectAttribute ( "PortalCount" ; "content" )

Obviously you can change 'PortalCount' to whatever you like.

If there's an easier (and less hacky) way to do this please let me know.

Share this post

Link to post
Share on other sites

Is your portal filtered? If not, the problem becomes "how to count related records" and can be solved by a calculation field in the parent table =

Count ( ChildTable::Matchfield )

or by defining a summary field in the child table and placing it on the layout of parent.

If the portal is filtered, you can place the summary field in a one-row portal that is filtered using the same filtering expression.

Only if the portal is filtered AND you need to use the count of shown records in a further calculation, you would need to use the GetLayoutObjectAttribute() function. But in such case it might be more appropriate to filter the relationship rather than the portal - IOW, work purely at the data level.


Edited by comment

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.