In my script I wanted to use formField.setError but when using formField.setError where do you define the customfield you want the error to set to?
Hi @Nannette Mori
First this function apply to Behaviour script only.
formField.setError means that you have define formField before with something like
formField = getFieldById("customfield_11111")
https://docs.adaptavist.com/sr4js/latest/features/behaviours/api-quick-reference
Regards
If I use formField = getFieldbyId("customfield_1111")
I get formField variable is not defined.
Yes it's was just an example, you have to adapt using the field id of the field you want to set the error under.
Yes I realize that - but when I used formField = getFieldById with my customfield I got the formfield is not a variable.
I am trying to use formfield with a date field
Are you in the Behaviour section of Scriptrunner ?
You need to define if so it will be something like that
def formField = getFieldById(....)
It looks like you're new here. Sign in or register to get started.