GetFieldValue
Description
Returns the FieldInfo object for the specified field.
This method returns a FieldInfo object from which you can obtain information about the field. This method does not return the actual value stored in the field. To retrieve the actual value (or values), call this method first and then call the FieldInfo object's GetValue or GetValueAsList methods.
You can use a field path name as the argument to this method. For more information, see "Using field path names to retrieve field values".
Syntax
VBScript
entity.GetFieldValue(field_name)
Perl
$entity->GetFieldValue(field_name);
- 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).
- field_name
- A String containing a valid field name of this Entity object. You can also use a FieldPathName.
- Return value
- The FieldInfo object corresponding to the specified field.
Examples
VBScript
set sessionObj = GetSession
' Iterate through the fields and output
' the field name and type.
fieldNameList = GetFieldNames
For Each fieldName in fieldNameList
fieldValue = GetFieldValue(fieldName).GetValue
sessionObj.OutputDebugString "Field name: " & fieldName & _
", value=" & fieldValue
Next
Perl
$sessionobj = $entity->GetSession();
# Iterate through the fields and output
# the field name and type.
$fieldnamelist = $entity->GetFieldNames();
foreach $fieldname (@$fieldnamelist)
{
$fieldinfobj = $entity->GetFieldValue($fieldname);
$fieldvalue = $fieldinfobj->GetValue();
$sessionobj->OutputDebugString("Field name: ".$fieldname. ",
value=".$fieldvalue);
}