Places the specified value in the named field.
Si la zone peut être modifiée, cette méthode définit sa nouvelle valeur, valide ou non, et renvoie la chaîne vide. To determine whether a field contains a valid value, obtain the FieldInfo Object for that field and call the ValidityChangedThisSetValue method of the FieldInfo object to validate the field.
Si la zone ne peut être modifiée, la chaîne renvoyée en indique la raison. Les valeurs type incluent "no such field", "record is not being edited" et "field is read-only".
Si la zone peut avoir plusieurs valeurs, utilisez la méthode AddFieldValue pour ajouter chaque nouvelle valeur. It is still legal to use SetFieldValue; however, using SetFieldValue on a field that already contains a list of values replaces the entire list with the single new value.
Vous pouvez uniquement appeler cette méthode si l'objet Entity est éditable. To make an existing Entity object editable, call the EditEntity method of the Session object.
VBScript
entity.SetFieldValue field_name, new_value
Perl
$entity->SetFieldValue(field_name, new_value);
VBScript
' Set two field values, but only check errors for
' the second field.
entity.SetFieldValue "field1", "new value"
returnVal = SetFieldValue("field2", "100")
Perl
# Set two field values for the entity
# Perform error checking on the second field
$entity->SetFieldValue("field1","new value");
$returnval = $entity->SetFieldValue("field2","100");