total field not sum

hi,

after installation of version 2020.0.15 the code does not calculate the sum.


{ // keys = event types, values = handler functions
“change keyup”: function(e) {

var $row = $(this).fields();
var st = $row[“Prz+Unt”].toNumber()*$row[“Ric”].toNumber()/100;
$row[“Prz_Ven”].value(st);
}
}

Check if there is any JavaScript error on the page (F12 → Console). To debug your codes, press F12 → Source, add a break point to step through the codes.

maxr167 wrote:

var st = $row[“Prz+Unt”].toNumber()*$row[“Ric”].toNumber()/100;

Double check your code above. If Prz and Unt are two different fields, you should separate each of field.

hi,

I checked with debug and F12 no errors … from version 2020.0.14 to version 2020.0.15
no changes have been made in the database and in the program.

  1. “Prz+Unt” is wrong field variable name (which is always alphanumerical, not work in older versions either). If it is really “Prz+Unt” in your database, the field variable name will be “Prz2BUnt”, see the topic Tools → Database, Table and Field Variable Names in the help file.
  2. Your code should also check the result of $row[“xxx”].toNumber() which may be null if the field is not filled. In such case your code will fail and you should see error in F12 → Console (assume you use Chrome).