CCBtx Posted August 28, 2012 Posted August 28, 2012 I love these undocumented features. 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? 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.
comment Posted August 28, 2012 Posted August 28, 2012 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...
CCBtx Posted August 28, 2012 Author Posted August 28, 2012 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.
comment Posted August 28, 2012 Posted August 28, 2012 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".
CCBtx Posted September 6, 2012 Author Posted September 6, 2012 Ok, Thanks. You are correct. I should have said "field".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now