GetFieldsUpdatedThisGroup

Description

Returns a FieldInfo Object for each field that was modified since the most recent call to BeginNewFieldUpdateGroup.

Use this method to mark the end of a group of calls to SetFieldValue (You must have previously called BeginNewFieldUpdateGroup to mark the beginning of the group.) This technique is useful for web-based systems where you might need to track any changes to the fields in a form. For example, if the user moves to another web page, you can call this method to save the current state of the form and restore it when the user returns to that page.

Syntax

VBScript


entity.GetFieldsUpdatedThisGroup 

Perl


$entity->GetFieldsUpdatedThisGroup(); 
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 whose value changed since the most recent call to BeginNewFieldUpdateGroup. If no fields were updated, this method returns an Empty Variant. For Perl, a FieldInfos Object collection is returned.

Examples

VBScript


BeginNewFieldUpdateGroup 
SetFieldValue "field1", "1" 
SetFieldValue "field2", "submitted" 
SetFieldValue "field3", "done" 
updatedFields = GetFieldsUpdatedThisGroup 

' Iterate over all the fields that changed 
For Each field In updatedFields 
   ' ... 
Next 

Perl


$entity->BeginNewFieldUpdateGroup()

$entity->SetFieldValue("field1", "1" );

$entity->SetFieldValue("field2", "submitted");

$entity->SetFieldValue("field3", "done");

$updatedFields = $entity->GetFieldsUpdatedThisGroup ();

$count = $updatedFields->Count();

# Iterate over all the fields that changed 

for ($x = 0; $x < $count ; $x++)

   {
   $field = $updatedFields->Item($x);

   # do other tasks...

 }