How can I return an enumeration value to a calculated value using javascript?
I have an attribute called Attention Flag which is an enumeration that contains "Reopened" and "Test Failed" as values in the enumeration list. I would like to have that attribute as read only and calculate the value based on other attributes using Javascript. I have tried using
return "Reopened"
or
return "Test Failed"
Both of these lines will properly return the value, but I get a warning red "x" flag on the attribute with the message "The selected value is not applicable." It does not show the corresponding enumeration value with the associated icon. I want it to show the enumeration value with the icon, not an error message. Is there a way to return a value that will be one of the valid values in the enumeration list?
One answer
I think you need to use the name of the literal. Check in the configuration source. It should have a name like "myenumeration.literal.l10";
Then you can do some thing like
return "myenumeration.literal.l10";
See this document under section "Working with Enumerations":