yuuvis® RAD Q&A

0 votes
by (510 points)
edited by

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?

by (510 points)
+1
Hello
My question has been answered. When viewed in isolation, my script section works perfectly. There seems to be an interaction with other script lines that have a “changeListener” built in for the “vatrate” table. This appears to have a negative effect on the Onchange event.

Please log in or register to answer this question.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 22, 2022 by Marcel Maier (750 points)
0 votes
1 answer
...