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 HCL Compass Designer. They cannot be set directly from the API.
Syntax
VBScript
entitydef.GetFieldDefType
field_def_name
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
.
Examples
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);
}
}