GetFieldNames

Description

Returns the names of the fields in the Entity object.

The list of names is returned in no particular order and there is always at least one field. You must examine each entry in the array until you find the name of the field you are looking for.

Syntaxe

VBScript

entity.GetFieldNames 

Perl

$entity->GetFieldNames(); 
Identificateur
Description
entity
Objet Entity représentant un enregistrement de données utilisateur. Si vous omettez cette partie de la syntaxe au sein d'un point d'ancrage, l'objet Entity correspondant à l'enregistrement de données en cours est faux (VBScript uniquement).
Return value
For Visual Basic, a Variant containing an Array whose elements are strings is returned. Each String contains the name of one field. Dans Perl, référence à un tableau de chaînes.

Exemples

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

   } 

Commentaires