GetFieldReferenceEntityDef

Descripción

Devuelve el tipo de registro al que hace referencia el campo especificado.

El campo especificado debe contener una referencia a otros registros. El tipo del campo especificado debe ser uno de los siguientes: REFERENCE, REFERENCE_LIST, JOURNAL o ATTACHMENT_LIST.

Sintaxis

VBScript

entitydef.GetFieldReferenceEntityDef field_name 

Perl

$entitydef->GetFieldReferenceEntityDef(field_name); 
Identificador
Descripción
entitydef
Un objeto EntityDef que corresponde a un tipo de registro de un esquema.
field_name
Un valor String que identifica un nombre de campo válido de Entitydef.
Valor de retorno
Un objeto EntityDef correspondiente al tipo de registro al que hace referencia el campo especificado.

Ejemplos

VBScript

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

' List the type of reference fields
nameList = entityDefObj.GetFieldDefNames()
For Each fieldName in nameList
   fieldType = entityDefObj.GetFieldDefType(fieldName)
   if fieldType = AD_REFERENCE Then
      set refEDefObj = entityDefObj.GetFieldReferenceEntityDef(fieldName)
      sessionObj.OutputDebugString refEDefObj.GetName()
   End If
Next 

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

  }

 } 

Comentarios