Refresh total amount
Hi,
I have a big problem with a calculation on my form or lets say it works in a strange way.
Well, I guess it had to do with the order they are calculated.
There are two fields (date) and one field (number) which calculates the difference of the two date fields as days.
E.g.
Field 1: 2018.01.26
Field 2: 2018.01.28
Field 3: 2
Field 4: 70€
That works correctly and they are updated immediatly when I'll change the date values. So far so good.
Then I've created 5 more fields format is number.
Where I can put more values into it to create a SubTotal.
The Subtotal would look like this:
140€ (which is 2x 70€ for the example above)
The SubTotal is created like
Sum1+Sum2+Sum3+Sum4+Sum5
Then I've also a Checkbox (Discount Yes/No) default to No.
When checked I display another Field where you can put a value into which will be substracted from the SubTotal field.
Now the Problem for the SubTotal field in the calculation event I placed the following:
Sum1, Sum2, Sum3, Sum4, Sum5
This works for the very first time but when I'll late change one of the date fields SubTotal isn't calculated anymore. Now the strange thing if I'll click the Discount checkbox 2 times the value for SubTotal is calculated correctly (I know that sounds a bit confusing at all.)
So my question would be ignoring the fact of possible wrong order for the calculation of the fields is there a way lets say a refresh I could send to the whole form to get the correct calculation? Well, or in other words what event happens when I check / uncheck the Discount checkbox because then it works? So maybe I can do the same from code to refresh the form.
