Howto set a javascript control BEFORE save action on RTC
Hi,
I want to setup a precondition on save action of a workitem in RTC.
I have made a "script based" Validation script, added a "Attribute Validation" in the configuration.
BUT, the javascript Validation script seems to be called AFTER the save, not before.
Does anybody konw how to run a javascript Validation script BEFORE the save action and how to cancel the save
action if the validation fail ?
Of Course, my validation script return a Status_KO if the validation do not pass.
One answer
Examples are here: https://jazz.net/library/article/1093 and https://jazz.net/wiki/bin/view/Main/AttributeCustomization also explains to use the precondition together with the validator to prevent a save.
Comments
Huuummmm.
Tried this example, with a attribute validator.
The validator is called after the workitem got a id. So it's too late. The workItem is saved in the database.
The validator is also called when the workitem is initialised, before any save action from the user. And the
return new Status(Severity["ERROR"], "my error message")
display a red tag on the field,it's ok, the message is visible in a tooltip, BUT the workitem is saved.
Any idea ? What do I missed ?
Also tried with a Condition. Same result.
Have you read up on the Precondition/Operational behavior configuration?
Thanks for this answer, but yes, I already did it before posting my message
This should work. Severity Error and the precondition should do the trick. Consider creating a case with support.
Is it because I use the workItem.getProxy() method ?
Like in this post : https://jazz.net/forum/questions/209992/still-able-to-save-when-an-attribute-is-invalid-but-only-when-the-work-item-proxy-is-accessed-in-the-validator-script
Same problem ?
Oh...No...With or without the getProxy(), same problem. The validator return status.KO_STATUS BUT the workItem is alway saved !
showing 5 of 6
show 1 more comments