FieldInfo Object
A FieldInfo object contains static information about one field of a user data record.
The FieldInfo object contains the information about one field of an Entity object. You can use the methods of FieldInfo to obtain the following information:
- The name of the field
- What type of data the field must contain
- Whether a value is required in the field
- Whether the field contains a value, and whether the value is valid
- What the error message is for an incorrect value
- What the value stored in the field is
- Whether the value or validity of the field has changed
A FieldInfo object is an informational object. All of its
methods are for getting, rather than setting, values. To change the value
stored in a field, use the SetFieldValue
method
of Entity.
A FieldInfo object is a snapshot of the corresponding field in the database. If you change the value of that field with a call to SetFieldValue, the existing FieldInfo object does not reflect the change. To obtain an updated value for the field, you must get a new FieldInfo object.
To get an instance of FieldInfo, call the GetFieldValue
method
of Entity, passing the name of the field as an argument. Other methods of
Entity allow you to return one or more instances of FieldInfo that satisfy
certain conditions. For for more details, see the methods of the Entity
Object.
As a convenience, Entity contains a few methods that act
as wrappers for FieldInfo methods. For example, the GetFieldType
method
of Entity is equivalent to the GetType
method
of FieldInfo. However, Entity also has some methods that have no FieldInfo
counterparts, such as the GetFieldOriginalValue
and
the GetFieldChoiceList
methods.