Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link

 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.

0 votes

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 ? 



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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 456
× 152

Question asked: Mar 18 '19, 9:16 a.m.

Question was seen: 2,067 times

Last updated: Mar 21 '19, 10:52 a.m.

Confirmation Cancel Confirm