Skip to main content
Known Participant
January 20, 2022
Question

long time or not at all to be updated

  • January 20, 2022
  • 2 replies
  • 883 views

When entering an extra amount, it takes a long time or not at all to be updated, both VAT and total amount. Can someone explain to me how this happens?

Fill in something and a 2nd one too, I hope someone can give me a solution?

This topic has been closed for replies.

2 replies

BarlaeDC
Community Expert
Community Expert
January 20, 2022

Hi,

 

You have this code in your file

/*********** belongs to: AcroForm:Betalen voor:Calculate ***********/ var dtStart = util.scand("dd-mmm-yyyy", this.getField("Factuurdatum").value);

if(dtStart) {

  dtEnd = new Date(dtStart.setDate(dtStart.getDate() + 21));

  this.getField("Betalen voor").value = dtEnd;

}

 

This calculate function, changes the value of the field that the calculate is on, therefore if it changes it would call the calculate again, and then call it again.

 

Probably better to move the code onto the validate of the field "Factuurdatum", so that is runs when that field is changed. This way it will only be run when it is changed, whereas calculate often runs when any field is changed.

Known Participant
January 20, 2022

That's really what I don't want. As soon as I enter an amount at unit price and quantity, there is a total amount. And if I enter data again on the next line, it is not updated at Total incl. VAT and the VAT 21% is not updated either.

Bernd Alheit
Community Expert
Community Expert
January 20, 2022

Change the field calculation order.

try67
Community Expert
Community Expert
January 20, 2022

It updates instantaneously for me, but the fields' calculation order is incorrect, so the results it's showing are not the right ones.

Known Participant
January 20, 2022

Can you help me with this with the document I sent.

In any case, thanks for your quick response.