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.

Running Total in Portal?

Featured Replies

Hi. I know how to summarize related data (Calc=Sum(Relationship::field))

However, I need a running total in a portal (like a bank book). Can ANYONE help?

Thank you in advance.

Hmm, the data is going to need to be in the source file to show in the portal. You will need to create a calculation field in each reocrd that sums all PREVIOUS records. I am not sure though if this is possible, at best it will be quite difficult.

Now of course you could script a loop to calculate the numbers and simple stick them into the field, or an autoentered calc which inserts the number at the time the record is created.

  • Author

Thanks. Actually, in the simplest form, no data needs to be in the Source file. Imagine the portal with just 2 fields: Number, and Running Balance.

Row 1, Number = 5, Balance = 5,

Row 2, Number = 7, Balance = 12... and so on.

The loop script could work, but I was hoping for a simpler Summary, or Calculation field that would avoid the potential problems of manual scripts, especially in a complex accounting setup.

  • Author

Solved, sort of, a Portal with a Number field and Running Balance.

In the Items file create 5 fields:

Master ID = Match field from Master File

Line Item ID = unique serial number for each line item

Number = Number (the user enters in the Portal)

Summary = Total of Number (check Running Total)

Balance = Calculation: GetSummary(SummaryField, Line Item ID)

In the Master File, put the Number and Balance fields in the Portal.

Make the Portal sort by Line Item ID.

The trick to the whole thing is to have a script that makes the Found Items file match the portal. (The summary calculations are taking place in the Items file, so the running total must be applied to the correct set of records. Too bad the Summary fields can not reference fields in related files.... FileMaker Inc???)

First in Items make a script that Sorts by Line Item ID.

(Perform a sort, then create a script with a Sort command to save it.)

In the Master DB, the script:

Freeze Window

Goto Related Records [items, show only related Items]

Perform Script [External, Items, Sort by Line Item ID]

Refresh Window

Now the portal will display user-entered numbers in the portal with a running total, as long as the above script is invoked after any changes. Note if you go to the next Master Record, the script must be applied, to make the Found Set in Items match the current portal. (FileMaker Programmers, I HOPE you read this!)

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.