GetFieldReferenceEntityDef
Description
Returns the type of record referenced by the specified field.
The specified field must contain a reference to other records. The type of the specified field must be one of the following: REFERENCE, REFERENCE_LIST, JOURNAL, or ATTACHMENT_LIST.
Syntax
Perl
$entitydef->GetFieldReferenceEntityDef(field_name);
- Identifier
- Description
- entitydef
- An EntityDef object corresponding to a record type in a schema.
- field_name
- A String that identifies a valid field name of entitydef.
- Return value
- An EntityDef object corresponding to the type of record referenced by the specified field.
Example
Perl
$sessionObj = $entity->GetSession();
$entityDefObj = $sessionObj->GetEntityDef($entity->GetEntityDefName());
# List the type of reference fields
$nameList = $entityDefObj->GetFieldDefNames();
foreach $fieldName (@$nameList)
{
$fieldType = $entityDefObj->GetFieldDefType($fieldName);
if ($fieldType eq $CQPerlExt::CQ_REFERENCE)
{
$refEDefObj = $entityDefObj->GetFieldReferenceEntityDef($fieldName);
$sessionObj->OutputDebugString($refEDefObj->GetName());
}
}