GetFieldDefNames

Description

Restituisce i nomi di campi definiti nell'oggetto EntityDef.

L'elenco di campi non viene restituito in un ordine specifico. È necessario esaminare ogni voce del vettore fino a quando non si individua il nome del campo desiderato.

Come per le altre parti di un oggetto EntityDef, l'amministratore imposta i campi definiti utilizzando Rational ClearQuest Designer. Tali campi non possono essere impostati direttamente dall'API.

Sintassi

VBScript

entitydef.GetFieldDefNames 

Perl

$entitydef->GetFieldDefNames(); 
Identificativo
Description
entitydef
Un oggetto EntityDef corrispondente ad un tipo di record in uno schema.
Valore di ritorno
Per Visual Basic, viene restituito un valore Variant che contiene un vettore i cui elementi sono stringhe. Ciascun valore String contiene il nome di un campo. Se l'oggetto EntityDef non contiene campi, il valore di ritorno sarà un valore Variant vuoto. Per Perl, un riferimento a un vettore di stringhe.

Esempi

VBScript

set sessionObj = GetSession
set entityDefObj = sessionObj.GetEntityDef(GetEntityDefName())

sessionObj.OutputDebugString "Field names for " &
       entityDefObj.GetName()

' List the field names in the record
nameList = entityDefObj.GetFieldDefNames()
For Each fieldName in nameList
   sessionObj.OutputDebugString fieldName
Next 

Perl

$sessionObj = $entity->GetSession();
$entityDefObj = $sessionObj->GetEntityDef($entity->GetEntityDefName());
$sessionObj->OutputDebugString("Field names for "$entityDefObj->GetName());
$nameList = $entityDefObj->GetFieldDefNames());
foreach $fieldName (@$nameList)
   {
 $sessionObj->OutputDebugString($fieldName);
   } 


Feedback