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.

Syntax

VBScript


entity.GetFieldNames 

Perl


$entity->GetFieldNames(); 
Identifier
Description
entity
An Entity object representing a user data record. Inside a hook, if you omit this part of the syntax, the Entity object corresponding to the current data record is assumed (VBScript only).
Return value
For Visual Basic, a Variant containing an Array whose elements are strings is returned. Each String contains the name of one field. For Perl, a reference to an array of strings.

Examples

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

   }