Skip 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.

Calculating Field... not calculating... the first time.

Featured Replies

I love these undocumented features. :hmm:

I have a calculating field named "TakeHome.Gross.Monthly" in the table LeaseCalc

The calculation is:

((LeaseCalc::TakeHome.PerPayPeriod.Person1 * PayPeriodFreq1::TimesPerYear) +

(LeaseCalc::TakeHome.PerPayPeriod.Person2 * PayPeriodFreq2::TimesPerYear))/12

So, if

LeaseCalc::TakeHome.PerPayPeriod.Person1 = 5000;

PayPeriodFreq1::TimesPerYear = 24;

LeaseCalc::TakeHome.PerPayPeriod.Person2 = 0; and

PayPeriodFreq2::TimesPerYear

Then "TakeHome.Gross.Monthly" would = 10,000 or $10,000 per month.

The variable appears on the second tab of a tab object.

Here is the problem. The first time my script runs (which sets the variables in the calculation)... and then switches to the appropriate tab, the value of the variable shows "0"

If I run the exact same script again... (which sets the variables in the calculation) the value populates.

Does anyone have any ideas? :grad:

BTW... one of the variables in the script, is the relationship variable that links to the table PayPeriodFreq1 and 2

If I look at all of the variables INDIVIDUALLY inside of Data Viewer, they all return the correct values.. except for the calculating field, "TakeHome.Gross.Monthly". And, again, once I run the same exact script the second time, the field populates.

One more thing. This only happens the FIRST time I run the script after I initially open the database. Once the script has executed twice, the variable populates properly from that point onward.

Thanks a lot.

I am confused: you started with a calculation field - then suddenly you are speaking of variables and scripts.

If I had to take a guess, you are populating a merged variable - but as there is nothing to cause a refresh of display...

  • Author

I'm confused as well.

I "triggered" the calculation field update by (i) committing the record and then (ii) resetting one of the variables inside the calculation.

Also, I forgot to mention that the calculation field is a global.

Thanks a lot for looking.

the calculation field is a global.

The calculation field should be unstored, since it references related fields. Then you won't need a script to trigger a refresh - it will re-evaluate on every screen redraw.

P.S. Please don't say "variable" when you mean "field".

  • 2 weeks later...
  • Author

Ok, Thanks. You are correct. I should have said "field".

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.