Can a JS value provider set an enumeration list attribute?
Accepted answer
As Don mentions from the https://jazz.net/wiki/bin/view/Main/AttributeCustomization documentation does state what is supported and list type attributes are mentioned nowhere. I think the list types appeared in RTC after the main JavaScript work was done.
One other answer
Try to set up a Script Based Value Set. And you need to set the attribute using this value set depend on the "condition"/attribute.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_Based_Value_Set
Comments
Donald, actually I am no trying to set a Value Set.
I am trying to set the values of an attribute, an enumeration list attribute.
If I want to insert 3 values into the attribute, what should I do?
I mean, the js Calculated Value script must return a variable containing the value to set.
For a scalar attribute, it is a scalar variable.
What kind of variable can set a multi-value attribute?
Perhaps this is not possible using JavaScript, and I should instead write a Java extension using the server-side SDK.
Ah...sorry for misunderstanding your question. Now you reminds me. IIRC I also had a hard time setting a value of an Enumeration List attribute. I tried CSV, JSON and other imaginable formats but all failed. You don't use a variable, the Calculated Value provider returns a "value" directly. I may give it another crack a bit later.
Edit: Have another look at the API spec. Even Enumeration is "limited support", and Enumeration List is not mentioned at all. So I think it's no go for JavaScript.
1 vote
Comments
Don Yang
Feb 15 '17, 7:53 p.m.similar discussion in https://jazz.net/forum/questions/209596/set-values-for-enumeration-list-programatically
Luca Martinucci
Feb 16 '17, 2:59 a.m.Hi Don,
the discussion does not really answer my question.
I need to know ho to set the values a multi-value attribute using a JavaScript value provider.
To set a single-value attribute, the script must return its (scalar) value.
What kind of variable must be returned when the attribute to set is a multi-value list?