I have a behaivour that changes the value of field_2 when field_1 is changed. But I want to allow the user to change the value of field_2. When the user clicks on the "Create" button, the behaivour is also triggered and the value of the field returns to default. How can I prevent this.
I use "formField.setFormValue()" function.
Hi @Barış Bayramoğlu ,
Initializer code is something that happens on form load (first time), Field specific code is something that happen on field change.
Please let us know your behaviour configuration.
Fabio
I have a category field (select list). I want to clear every field on the form when category field is changed. I can do this with using setFormValue() but when I click to "Create" button, setFormValue()s clear all fields again and my form is going empty. So I want to prevent this situation.
*When the "Create" button is clicked, scriptrunner thinks that my category field has been updated and runs the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please could you attach your script code?
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.
Please could you try to put setFormValue method after setFieldOptions ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all, sorry for the late reply, I tried your suggestion:
formSelect.setFieldOptions(options.findAll { it.value in endUserAssets }.collectEntries {
[(it.optionId): it.value]
}).setFormValue(options.getOptionForValue(endUserAssets[0], null).getOptionId())
But the problem remains.
I solved the problem somewhat indirectly, but I'm attaching screenshots of the actual problem. If you know anything about it, I'd be grateful if you could help
As you can see, I select Monitor in customer portal.
But when I click the "create" button.
Asset type changes to "Notebook" as follows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Barış Bayramoğlu please check if there is some postfuncion on create transition (on workflow level) that change that value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fabio Racobaldo [Catworkx] No there is no postfunction on create transition that changes the "Asset Category" or "Asset Type"
I think the "create" button somehow triggers the behaviour script.
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.