Copy link to clipboard
Copied
Hello. i have varv1 and varv2. and i want varv2<=varv1 if not it wrong
I START LIKE THIS
// Get field values as numbers
var v1 = +getField("Textfield66").value;
var v2 = +getField("Textfield67").value;
how can i end it?
Thanks
Add this at the end of your code:
if (v2<=v1) app.alert("Error! v2<=v1");
Copy link to clipboard
Copied
Hello i have this script but it is not working
Format persentage
validation script
// Get field values as numbers
v1 = +getField("Textfield28").value;
v2 = +getField("Textfield34").value;v3 = +getField("Textfield40").value;v4 = +getField("Textfield46").value;v5 = +getField("Textfield52").value;
v6 = +event.value;
if (v6>v1+v2+v3+v4+v5){ app.alert("ΛΑΘΟΣ! 612 μεγαλύτερο του 611 οι Εισαγωγές αγαθών εντός του ομίλου πρέπει να είναι μικρότερες η ίσες με τις Συνολικές Εισαγωγές αγαθών");
event.rc = false;
}
Copy link to clipboard
Copied
Saying "it's not working" is not very helpful... What exactly goes wrong?
Copy link to clipboard
Copied
ok first ι used to validate the above script.Then to format persentage and finally to calculate i used value is the sum(+) of the following fields (Textfield28+.........)
What exactly i need is that the sum(+) of var1,var2,var3,var4,var5 must not be more than 100%(1) and less than 100%(1).It must be 100%
{ app.alert(" the sum(+) of var1,var2,var3,var4,var5 must not be more than 100%(1) and less than 100%(1).It must be 100%");
event.rc = false;
}
for example if i will write to the first cell 50% and to the second cell 60% this should not let the user go ahead.
Another example is first cell 20%.second 20%,third 20%,fourth 20% and fifth 10%.That is less than 100% and it is wrong.
Thanks
Copy link to clipboard
Copied
Your syntax error is very clear from the message. Programmers often get this kind of error, and the solution is to carefully count brackets.