GetFieldsUpdatedThisAction
Description
Returns a FieldInfo object for each field that was modified by the most recent action.
This method reports the fields that changed during the current action, that is, all fields that changed after the call to BuildEntity or EditEntity returned. Fields that were implicitly changed during the action's initialization (which includes FIELD_DEFAULT_VALUE hooks setting initial default field values) are not reported; fields that were modified by hooks during the initialization of the action are also not reported. This method does report fields that were changed by hooks after the initialization phase of the action; see the HCL Compass Designer documentation for the timing and execution order of hooks.
As an example, if the user initiates a CHANGE_STATE action, the value in the record's "state" field changes but is not reported by this method. Similarly, if the action-initialization hook of the action modifies a field, that change is not reported. However, changes that occurred during a field value-changed hook or a validation hook are reported because they occur after the action is completely initialized.
Syntax
VBScript
entity.GetFieldsUpdatedThisAction
Perl
$entity->GetFieldsUpdatedThisAction
();
- 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 of FieldInfo Objects is returned.
Each FieldInfo object corresponds to a field of the Entity object
whose value was changed since the most recent action was initiated.
If no fields were updated, this method returns an Empty Variant.
For Perl, a FieldInfos Object collection is returned.
Examples
VBScript
set sessionObj = GetSession
' Report any fields that changed during the recent action
fieldList = GetFieldsUpdatedThisAction
For Each field in fieldList
' Report the fields to the user
sessionObj.OutputDebugString "Field " & field.GetName & "
changed."
Next
Perl
$sessionobj = $entity->GetSession();
# Report any fields that changed during the recent action
$fieldlist = $entity->GetFieldsUpdatedThisAction();
# Find out how many duplicates there
# are so the for loop can iterate them
$updatedfields = $fieldlist->Count();
for ($x = 0; $x < $updatedfields ; $x++)
{
# Report the fields to the user
$sessionobj->OutputDebugString("Field ".$fieldlist->Item($x)->GetName."
changed." )
}