Hi Team
I have written a script like when field value not equal to null then i should get error message
def field = getFieldByName("Alternate Approver")
def fieldvalue = field.getValue()
if(fieldvalue!= null)
{
field.setError("Error Message")
}
but the above script is showing error message when value is empty also
Please help me on this
Thanks
Sagar
Hi @Venkata Sagar Ganesh Rao Mahendrakar
Please try using below script,
def field = getFieldByName("Alternate Approver")
def val = field.formValue as String
if (val) {
field.setError("Error Message")
}
else {
field.clearError()
}
Hope this helps you !
Regards,
Yogesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have written this script in ScriptRunner Behavior
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Even tried below not working
def field = getFieldByName("Alternate Approver")
def fieldvalue = field.getValue()
field.clearError();
if(fieldvalue!= null)
{
field.setError("Error Message")
}
Please Help Me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.