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.

Counting Portal Records

Featured Replies

Hey guys,

I'd like to do 2 things that can be accomplished with the same function, I'd first like to put a field on a layout that shows the total number of portal records, also I'd like to prevent a record in one table from being deleted if it has related records in another.

Is there a function that will return the number of portal rows or the number of related records?

Use the Count function.

To prevent deletion, don't allow access to the menu and script it instead, testing for related records first.


If [isEmpty(relationship::serial)]

  Delete Record/Request 

Else

  Show Custom Dialog [This record cannot be deleted.]

End If

  • Author

Thanks guys, appreciate the assistance. Sometimes the answer is so easy you overlook it eh?

Sorry for being dense but where would you put the Count function to have it count the portral rows? I tried using a field on the layout and used

Count (table::field)

with table being the table the portal is based on and field being a field displayed in the portal. I got a "?" as my result.

How many related records are there? How wide is your field? If the number cannot fully fit on the field with its current width, it will display a question mark.

The number of related records varies from as few as 1 to as many as 115. I have the result field set very large.

I am going through a couple of table occurrences to get the relationship that I need. Does it have to be based on a real table or can I count through a table occurence?

I would think using the TO on which the portal is based should work. Can you zip a sample copy of your file and attach it for investigation?

I'll have to make a smaller file before I can zip and load. Mine's pretty hefty right now. And I think I'll have to do it tomorrow as I have to leave the office in a few minutes. Sorry for the delay when you are willing to help now.

Meanwhile, a quick question, would you put the function in a field in the table that the layout is based on or put the function in a field somewhere else? I have it in my table of globals, which has one record. This works great for displaying what I want to display in the portals, by the way. I just can't get a count of the portal rows. The only time I get an answer other than "?" is when I pick the original data table and not one of the table occurences of the same data. They're both linked to global through the same IDNumber field.

I figured out why it wouldn't work. I'm using a data file that is separate from the user interface. The table occurence I'm referencing doesn't exist in the data file, just in the user interface. So I had to create the reference in the data file and then do the count from there.

Thanks for your help. smile.gif

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.