GetFieldReferenceEntityDef

Descrizione

Restituisce il tipo di record a cui fa riferimento il campo specificato.

Il campo specificato deve contenere un riferimento ad altri record. Il tipo di campo specificato deve essere uno dei seguenti: REFERENCE, REFERENCE_LIST, JOURNAL o ATTACHMENT_LIST.

Sintassi

VBScript

entitydef.GetFieldReferenceEntityDef field_name 

Perl

$entitydef->GetFieldReferenceEntityDef(field_name); 
Identificativo
Descrizione
entitydef
Un oggetto EntityDef corrispondente ad un tipo di record in uno schema.
field_name
Una stringa che identifica un nome di campo valido dell'oggetto entitydef.
Valore di ritorno
Un oggetto EntityDef corrispondente al tipo di record a cui fa riferimento il campo specificato.

Esempi

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

  }

 } 

Feedback