Hello,
we want the “netamount” field to be a mandatory field in the table "vatrates", and we also need to ensure that there is at least one row in the table. We have tried that in yRAD 9.16 and 10.16.
Here is our script:
function checkvatrates() {
if (scope.model.vatrates.value === null || scope.model.vatrates.value.length < 1) {
scope.model.vatrates.error = { msg: 'Mindest eine Zeile in Tabelle Steuerbeträge benötigt' };
} else {
scope.model.vatrates.error = null;
}
}
if (scope.situation !== 'SEARCH') {
checkvatrates();
scope.model.vatrates.onrowedit=function(table,row){
row.model.netamount.required=true;
checkvatrates();
}
scope.model.vatrates.onchange=function(table,row){
checkvatrates();
}
}
(quoting seems not to work -preview always quotes just parts of my code)
The script works, but if I delete the row after creating it, no error is displayed. What are we doing wrong?
