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

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.
Return value
A reference to an array of strings is returned.

Example

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

   }