Places the specified value in the named field.
If the field can be changed, this method sets its new value, regardless of whether that value is valid, and returns the empty String. 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.
If the field cannot be changed, the returned String indicates why the field cannot be changed. Typical values include "no such field", "record is not being edited", and "field is read-only".
If the field can have multiple values instead of just one, use the AddFieldValue method to add each new value. 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.
You can call this method only if the Entity object is editable. 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");