Skip to main content
RealEventDesigns
Participant
February 7, 2018
Question

Sum function script not updating field when variables being blank

  • February 7, 2018
  • 1 reply
  • 753 views

Earlier, I asked how to hide values if the the value=0 and got the correct script to put in.

The script I used for this was:

var amount = Number(this.getField("Qty2").value) * Number(this.getField("UP2").value);

event.value = (amount==0) ? "" : amount;

However, the sum function for the "Subtotal" field is now not updating. I am using the sum function in the calculator tab. Am I suppose to put in a script now or can I still use the sum function? Please see the snapshot below. Thanks!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 7, 2018

Check the field calculation order. The Subtotal field needs to be calculated after the Amount field(s).

RealEventDesigns
Participant
February 8, 2018

Thanks!

I had to manually type in the addition of each field as the sum function doesn't do it in the correct order.

Thanks for all your help!

try67
Community Expert
Community Expert
February 8, 2018

That means you didn't solve the problem I pointed out...