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
Ralph Schoon (63.6k●3●36●47)
| answered Mar 18 '19, 9:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 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
Olivier ROSET
commented Mar 18 '19, 12:30 p.m.
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.
Ralph Schoon
commented Mar 18 '19, 12:36 p.m.
| edited Mar 18 '19, 12:37 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Have you read up on the Precondition/Operational behavior configuration?
Ralph Schoon
commented Mar 18 '19, 12:38 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Olivier ROSET
commented Mar 19 '19, 6:50 a.m.
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
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.