GetFieldNames

Description

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 del vettore fino a quando non si individua il nome del campo desiderato.

Sintassi

VBScript

entity.GetFieldNames 

Perl

$entity->GetFieldNames(); 
Identificativo
Description
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 vettore i cui elementi sono stringhe. Ciascun valore String contiene il nome di un campo. Per Perl, un riferimento a un vettore 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 fieldInfoObj = GetFieldValue(fieldName)
   fieldType = fieldInfoObj.GetType
   fieldValue = fieldInfoObj.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)

   { 

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

    $fieldtype = $fieldinfoobj->GetType();

    $fieldvalue = $fieldinfoobj->GetValue();



    $sessionobj->OutputDebugString(

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

        value=".$fieldvalue);

   } 


Feedback