Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Calculation No Longer Works if a Value in a Field is deleted

Avatar

Avatar
Validate 1
Level 1
Beachbum2015
Level 1

Likes

2 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Beachbum2015
Level 1

Likes

2 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Beachbum2015
Level 1

03-09-2015

I've got an issue where a FormCalc calculation stops working if I delete a value in a field that is part of the formula.

Here's a link to the test form:  https://www.dropbox.com/s/3w6weyd3bp5dfss/Test_Totals.pdf?dl=0

When I enter the values in the table as below, the calculation in the CASH DUE EMPLOYEE field works fine.

Total_B.jpg

If I delete the value in the CASH ADVANCE field, the calculation in the CASH DUE EMPLOYEE field doesn't recalculate.  In the below example, I deleted the cash advance, so the CASH DUE EMPLOYEE should be $100, but yet the field goes blank.

Total_A.jpg

Here's the FormCalc script in the CASH DUE EMPLOYEE field:

if (Table1.Row1.Total_E_Exp.rawValue > Table1.Row2.Cash_Adv.rawValue) then

   Cash_Due_Employee.rawValue = Table1.Row1.Total_E_Exp.rawValue - Table1.Row2.Cash_Adv.rawValue

else

   Cash_Due_Employee.rawValue = 0

endif

I just can't figure out why the field isn't recalculating after I delete the value in the CASH ADVANCE field.

Any help would be appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 2
PDFGuru
Level 2

Likes

14 likes

Total Posts

75 posts

Correct Reply

10 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Level 2
PDFGuru
Level 2

Likes

14 likes

Total Posts

75 posts

Correct Reply

10 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
PDFGuru
Level 2

07-09-2015

Not sure why FornCalc is not working, but same logic works fine JavaScript.

Check the form at following link:

Dropbox - Test_Totals2.pdf

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 1
Beachbum2015
Level 1

Likes

2 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Beachbum2015
Level 1

Likes

2 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Beachbum2015
Level 1

11-09-2015

XIIIX,

I was using Numeric fields, along with the same pattern setup, but no luck.  Switching to Javascript corrected the issue.

Avatar

Avatar
Validate 1
Level 1
Beachbum2015
Level 1

Likes

2 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Beachbum2015
Level 1

Likes

2 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Beachbum2015
Level 1

11-09-2015

PDFGuru,

Thanks for the info.  I switched the calculation from Formcalc to JavaScript and it works fine now.

Avatar

Avatar
Validate 1
Level 1
XIIIX-inTVbY
Level 1

Like

1 like

Total Posts

17 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
XIIIX-inTVbY
Level 1

Like

1 like

Total Posts

17 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
XIIIX-inTVbY
Level 1

09-09-2015

use "Number Fields" from the object pallette (NOT text fields) - amend settings in Patterns > "allow zero" + set "currency{}" as data format.

deleting field value will produce this display value "$0.00" and NOT " " [AKA 'empty field']