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 nombre_campo 

Perl

$entitydef->GetFieldReferenceEntityDef(nombre_campo); 
Identificador
Descripción
entitydef
Un objeto EntityDef que corresponde a un tipo de registro de un esquema.
nombre_campo
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())

' Listar el tipo de campos de referencia
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());



# Listar el tipo de campos de referencia

$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