指定されたフィールドに格納できるデータのタイプを識別します。
GetFieldDefNames メソッドを使用すると、有効なフィールド名のリストを取得できます。
レコード タイプに基づいて、対応するデータ レコードの各フィールドに格納できるデータのタイプを制御します。フィールドには、文字列、数値、タイム スタンプ、参照などを格納できます。(完全なリストについては、「FieldType 定数」を参照してください)。
EntityDef オブジェクトの他の部分と同様に、管理者が Rational ClearQuest Designer を使用して定義済みフィールドを設定します。 これらは、API から直接には設定できません。
VBScript
entitydef.GetFieldDefType field_def_name
Perl
$entitydef->GetFieldDefType(field_def_name);
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); } }