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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you in the Behaviour section of Scriptrunner ?
You need to define if so it will be something like that
def formField = getFieldById(....)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.