4 Replies Latest reply on Sep 11, 2015 12:07 PM by Beachbum2015

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

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.

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.

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

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

• ###### 1. Re: Calculation No Longer Works if a Value in a Field is deleted

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

Check the form at following link:

Dropbox - Test_Totals2.pdf

• ###### 2. Re: Calculation No Longer Works if a Value in a Field is deleted

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']

• ###### 3. Re: Calculation No Longer Works if a Value in a Field is deleted

PDFGuru,

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

• ###### 4. Re: Calculation No Longer Works if a Value in a Field is deleted

XIIIX,

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