Hello everyone,
I have the following code in a ScriptRunnert Behaviour:
def nif = getFieldByName("NIF")
nif.setHidden(true)
def dni = getFieldByName("DNI")
def number = dni.getValue()
def resto = number % 23
if (resto == 0) {
nif.setHidden(false)
def x = dni.getValue().append("T")
nif.setFormValue(x)
} else if (resto == 1){
nif.setHidden(false)
def x = dni.getValue().append("R")
nif.setFormValue(x)
}
and I get several errors.
The idea is to fill in the custom field "NIF" with the number of the custom field "DNI", and depending on the remainder of the division : number / 23 , to add a letter to it, so that NIF=DNI+Letter
I would be very grateful if anyone could help me, please.
Thanks in advance.
Almu