Setting an attribute value from script
![]() Hello Guys, I am trying to make few fields read only based on condition. I can do it by settting up 'Operational Behaviour' in the project area. Apart from this, before settting up the values read only, i should also be able to set the value to zero. Is it possible to set the value from a js script before setting it to read only. Belwo is the script.
dojo.provide("net.jazz.example.readonly.Condition");
if (dropdownvalue=="inex.literal.l4")
Thanks..Johnson
|
3 answers
![]()
you will not be able to do this with a single routine. you 'might' be able to code multiple functions in a single script file, but RTC has discreet function requests for each action, so you will have to register each separately
default value current value changeable or not |
![]()
I would agree with Sam and I would doubt if everything can be done in a single script. As per my understanding here is what I think:
One part is already taken care by your script. To make the attributes mandatory, in the Attribute Customization section you can add a script based Validation which will check if the attribute values are null and then add Attribute Validation precondition from the Operation Behavior section. ( you can find further help in https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_Based_Validation) Now, your comment "In another scenario...." is something sounds contradictory to me. On one hand you are saying that if the value is Exclude then the other attributes will be "readonly" whereas you are trying to change or set the value to 0. May be something to think of if a different approach is easier; however, you can try this with Script based Calculated Values. |