SetFieldValues

Description

Places the specified values in the named fields. This method allows multiple field values to be set with one call. The two input string arrays are parallel lists, where field_names lists the field names and new_values lists the field values. For example, item N in field_names provides the field name and item N in new_values provides the value for that field.

The return value is an array of result messages for each field. Each result message is the same message that is returned by a single call to the SetFieldValue method. If there are no errors, the result is a String array of the same number of elements as field_names, with each element being an empty String.

Remarque : This method became available in version 2003.06.00.

Syntaxe

VBScript

entity.SetFieldValues field_names, new_values 

Perl

$entity->SetFieldValues (field_names, new_values); 
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).
field_names
The list of field names for values to be set.

Dans VBScript, valeur de type Variant contenant un tableau de chaînes. Each String contains a valid field name of this Entity object.

For Perl, a reference to an array of strings containing the valid field names.

new_values
The list of field values to set for the specified field names.

Dans VBScript, valeur de type Variant contenant un tableau de chaînes. Each String contains a field value.

For Perl, a reference to an array of strings containing the new values.

Return value
For VBScript, a Variant containing an array of result messages for each field.

For Perl, a reference to an array of strings containing the result messages for each field.

S'il est possible de modifier la zone, cette méthode renvoie une chaîne vide ; sinon, elle renvoie une chaîne contenant une explication de l'erreur.

Exemples

VBScript

Dim FieldList
ReDim FieldList(2)	' This sets up an array of three elements
Dim ValList
ReDim ValList(2)
FieldList(0)="new_field"
FieldList(1)="new_field2"
FieldList(2)="new_field3"
ValList(0)="f1"
ValList(1)="f2"
ValList(2)="f3"
entity.SetFieldValues FieldList, ValList 

Perl

my @fieldnames = ("submitter", "owner");
my @fieldvalues = ("userA", "userB");

$entity->SetFieldValues(\@fieldnames, \@fieldvalues);

Commentaires