Sets a list of acceptable values for the field. Resets a dynamic choice list. Can be used with InvalidateFieldChoiceList to empty any values already stored.
Use this function to force the Rational® ClearQuest client to fetch the new choice list values for the field.
You can design your schema so that Rational ClearQuest recalculates a choice list every time a user interacts with it (no cached values), or only the first time (cached values). If you want to refresh cached values, call InvalidateFieldChoiceList to empty any cached values, then call SetFieldChoiceList to reinitialize the values. (The first time the choice list appears, there is no need to call InvalidateFieldChoiceList because no values pre-exist in cache memory.)
Use these two methods in a Value Changed Field hook. For example, if the end-user selects a new item from the list of projects, the record type changes, and the form needs a refreshed dependent choice list.
VBScript
entity.SetFieldChoiceList fieldName, (choiceList)
Perl
$entity->SetFieldChoiceList(fieldName, choiceList);
VBScript
fieldchoicelist3 = array("hello", "world", "goodbye")
SetFieldChoiceList "severity", (fieldchoicelist3)
Perl
$entity->SetFieldChoiceList($fieldname, \@choiceList);
# Add choices by adding strings to the array of field choices