GetFieldDefType

Description

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

You can use the GetFieldDefNames method to obtain a list of valid field names.

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

Like the other parts of an EntityDef object, the administrator sets the defined fields using DevOps Plan Designer. They cannot be set directly from the API.

Syntax

Perl


$entitydef->GetFieldDefType(field_def_name); 
Identifier
Description
entitydef
An EntityDef object corresponding to a record type in a schema.
field_def_name
A String that identifies a valid field name of entitydef.
Return value
A Long that specifies what type of data can be stored in the named field. The value corresponds to one of the FieldType constants.

Example

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);

  }

 }