GetFieldNames

Descrizione

Restituisce i nomi di campi nell'oggetto Entity.

L'elenco dei nomi non viene restituito in un ordine specifico ed esiste sempre almeno un campo. È necessario esaminare ogni voce dell'array fino a quando non si individua il nome del campo desiderato.

Sintassi

VBScript

entity.GetFieldNames 

Perl

$entity->GetFieldNames(); 
Identificativo
Descrizione
entity
Un oggetto Entity che rappresenta un record di dati dell'utente. All'interno di un hook, se si omette questa parte della sintassi, viene utilizzato l'oggetto Entity corrispondente al record di dati corrente (solo VBScript).
Valore di ritorno
Per Visual Basic, viene restituito un valore Variant che contiene un array i cui elementi sono stringhe. Ciascuna stringa contiene il nome di un campo. In Perl, un riferimento ad un array di stringhe.

Esempi

VBScript

set sessionObj = GetSession

' Iterate through the fields and output
' the field name, type, and value
fieldNameList = GetFieldNames
for each fieldName in fieldNameList
   set fieldInfObj = GetFieldValue(fieldName)
   fieldType = fieldInfObj.GetType
   fieldValue = fieldInfObj.GetValue

   sessionObj.OutputDebugString "Field name: " & fieldName & _
      ", type="  & fieldType & ", value=" & fieldValue 
Next 

Perl

# get session object

$sessionobj = $entity->GetSession();



# get a reference to an array of strings

$fieldNameList = $entity->GetFieldNames();



foreach $fieldname (@$fieldNameList)

   { 

    $fieldinfobj = $entity->GetFieldValue($fieldname);

    $fieldtype = $fieldinfobj->GetType();

    $fieldvalue = $fieldinfobj->GetValue();



    $sessionobj->OutputDebugString(

        "Field name: ".$fieldname.", type=".$fieldtype.",

        value=".$fieldvalue);

   } 

Feedback