SetFieldChoiceList

Description

Remarque : To call this method from an external script, the user must have ClearQuest Administrator privileges.

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.

Syntaxe

VBScript

entity.SetFieldChoiceList fieldName, (choiceList) 

Perl

$entity->SetFieldChoiceList(fieldName, choiceList); 
Identificateur
Description
entity
Objet Entity représentant un enregistrement de données utilisateur. Si vous omettez cette partie de la syntaxe au sein d'un point d'ancrage, l'objet Entity correspondant à l'enregistrement de données en cours est faux (VBScript uniquement).
fieldName
A String that identifies a valid field name of an entity.
choiceList
For VB, a Variant containing an array of strings.For Perl, a reference to an array of strings.
Valeur renvoyée
Aucune.

Exemples

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 

Feedback