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.

Featured Replies

Hi. I have created a running counter to keep track of which record I'm on. Since my file contains multiple account numbers, I first created a self-joined relationship called "self," where account number =::account number. My counter, then, is a number with an auto-entered calculation that looks like this: Count(self::account number)

It works fine while I create new records. The counter dutifully enters the correct number of the record I'm on, after I enter the account number for the new record. So the 5th record with account number "3443" would have a counter value of 4, while a new record with a new account number yields a value of 0 (I know it doesn't start at one, but that's okay).

It gets messed up, however, if I delete a record, or change the account number of that record, because the counter does not dynamically change. So, is there a way to create a counter that dynamically updates if I change the account number, or if I delete a record?

Thanks.

-Emery

Ps: a calculation field won't work, because it dynamically updates all instances of that field, so it gives me the total number of records on each page. What I need is a running counter, not a total counter.

Auto-enter calculations only evaluate when the record is created. You will have to script the field to change when a record is deleted or the account number is changed. I think the best way to accomplish this would be as follows:

When a record is deleted,

Go to Related Record [show, "self"]

Go to Record/Request/Page [First]

Loop

Set Field [counter, Status(CurrentRecordNumber) - 1]

Go to Record/Request/Page [Exit after last, Next]

End Loop

When a record's account number is modified, you would need a global to hold the original account number. Perform the above script steps, then run the same script, but use a relationship from the global to account number. This will reset both accounts with the proper counters.

  • Author

Thanks, I'll try that. BTW, I've only activated scripts thru the menu, or via a button. Is that what you're thinking of, or is there a way for this script to automatically run?

thanks for your help.

-Emery

Have your own Delete button and attach -Queue-'s script to it, in addition to the regular delete command for the record in question.

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.