GetFieldDefType

Description

Identifica el tipo de datos que se pueden almacenar en el campo especificado.

Puede utilizar el método GetFieldDefNames para obtener una lista de nombres de campo válidos.

El tipo de registro controla el tipo de datos que se pueden almacenar en cada campo de un registro de datos correspondiente. Los campos pueden almacenar series, números, indicaciones de la hora y referencias, entre otros. (Consulte el apartado Constantes de FieldType para obtener la lista completa).

Como los demás componentes de un objeto EntityDef, el administrador establece los campos definidos utilizando Rational ClearQuest Designer. No se pueden establecer directamente desde la API.

Sintaxis

VBScript

entitydef.GetFieldDefType field_def_name 

Perl

$entitydef->GetFieldDefType(field_def_name); 
Identificador
Description
entitydef
Un objeto EntityDef que corresponde a un tipo de registro de un esquema.
field_def_name
Un valor String que identifica un nombre de campo válido de Entitydef.
Valor de retorno
Valor Long que especifica el tipo de datos que se pueden almacenar en el campo denominado. El valor corresponde a una de las constantes de FieldType.

Ejemplos

VBScript

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

sessionObj.OutputDebugString "Integer fields of " & _
            entityDefObj.GetName()

' List the field names in the record that contain integers
nameList = entityDefObj.GetFieldDefNames()
For Each fieldName in nameList
   fieldType = entityDefObj.GetFieldDefType(fieldName)
   if fieldType = AD_INT Then
      sessionObj.OutputDebugString fieldName
   End If
Next 

Perl

$sessionObj = $entity->GetSession();

$entityDefObj =
      $sessionObj->GetEntityDef($entity->GetEntityDefName());



$sessionObj->OutputDebugString("Integer fields of ".$entityDefObj.GetName());



# List the field names in the record that contain integers

$nameList = $entityDefObj->GetFieldDefNames();



foreach $fieldName (@$nameList)
   {
 $fieldType = $entityDefObj->GetFieldDefType($fieldName);

 if ($fieldType eq $CQPerlExt::CQ_INT)

  {

  $sessionObj->OutputDebugString($fieldName);

  }

 } 

Comentarios