GetFieldType

Description

Identifies the type of data that can be stored in the specified field.

The EntityDef Object controls what type of data can be stored in each field of an Entity object. Fields can store strings, numbers, timestamps, references, and so on. (See FieldType constants for the complete list.)

You cannot change the type of a field using the API. The field type is determined by the corresponding information in the EntityDef object and must be set by the administrator using Rational ClearQuest Designer.

You can use the GetFieldNames method to obtain a list of valid names for the field_name parameter.

Syntaxe

VBScript

entity.GetFieldType(field_name) 

Perl

$entity->GetFieldType(field_name); 
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).
nom_zone
Chaîne identifiant un nom de zone valide d'entité.
Valeur renvoyée
A Long that identifies what type of data can be stored in the named field. The value corresponds to one of the FieldType constants.

Exemples

VBScript

set sessionObj = GetSession 

' Iterate through the fields and output 
' the field name and type. 
fieldNameList = GetFieldNames 
For Each fieldName in fieldNameList
   fieldType = GetFieldType(fieldName)
   sessionObj.OutputDebugString "Field name: " & fieldName & _ 
         ", type=" & fieldType 
Next 

Perl

$sessionobj = $entity->GetSession();



# Iterate through the fields and output 

# the field name and type. 



$fieldnamelist = $entity->GetFieldNames();



foreach $fieldname (@$fieldnamelist){
 $fieldtype = $entity->GetFieldType($fieldname);

 $sessionobj->OutputDebugString("Field name: ".$fieldname. ",
          type=".$fieldtype);

 } 

Feedback