It's all about the answers!

Ask a question

Howto set a javascript control BEFORE save action on RTC


Olivier ROSET (50121) | asked Mar 18 '19, 9:16 a.m.
 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



permanent link
Ralph Schoon (63.1k33646) | 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


Ralph Schoon commented Mar 19 '19, 6:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This should work. Severity Error and the precondition should do the trick. Consider creating a case with support. 


Olivier ROSET commented Mar 21 '19, 9:54 a.m. | edited Mar 21 '19, 10:52 a.m.

 Is it because I use the workItem.getProxy() method ? 



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


Register or to post 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.