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 Rational ClearQuest 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.

Syntaxe

VBScript

entity.GetFieldsUpdatedThisAction

Perl

$entity->GetFieldsUpdatedThisAction();
Identificateur
Description
entity
Objet Entity représentant un enregistrement de données utilisateur. Si vous omettez cette partie de la syntaxe au sein d'un point d'ancrage, l'objet Entity correspondant à l'enregistrement de données en cours est faux (VBScript uniquement).
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.

Exemples

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." )

}

Commentaires