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.

value from different field in previous record?

Featured Replies

  • Newbies

i'm trying to calculate the value of a field in a new record from the value of a *different* field in the previous record.

essentially, i'm trying to track something from day to day, and my calculations of one field involve the change from previous day's value of another field. and i'm trying to do it automagically when the new record is created.

so Field1 = yesterday's Field2 - today's Field2

i can't get my head around the relationship/portal thing in this case, or figure out a script that would do it in an auto-enter...

any ideas?

Create fields:

RecordNum (number, autoenter, serial number, indexed)

PrevRecNum (calculation, number, indexed) = RecordNum - 1

Create a self relationship called PrevRec with PrevRecNum <--> RecordNum

To create a new record (script)

New Record/Request

Set Field(Field1, PrevRec::Field2 - Field2)

If you are worried about deleted records breaking this approach, don't auto enter RecordNum, do the following:

Define a field:

Constant (calculation, number, indexed) = 1

Create a self relationship (call it "SelfRel") with Contant <--> Constant

Create a slightly different new record script:

New Record/Request/Page

Set Field(RecordNum, Max(SelfRel::RecordNum) + 1)

Set Field(Field1, PrevRec::Field2 - Field2)

-bd

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.