Documentation Center

FieldValue Property

Gets or sets the value of Field.

Syntax

LanguageSyntax
C#Object FieldValue { get; set; }
Visual Basic (Declaration)Property FieldValue As Object
Visual C++property Object^ FieldValue { Object^ get (); void set Object (^ value); }

Field Value

The value of the Field object.

Remarks

  • When this value is set, the IsModified property is set to true.
  • When a value is set using the SerializedValue property, the SerializedValue property will trigger deserialization of the underlying value and set the deserialized value to the FieldValue property. If an error occurs during deserialization, the value will be ignored, and the error will be raised.
  • When the Field object is initialized, and a default value is configured in the associated metadata configuration value element, the object will attempt to initialize the FieldValue property with the default value if the FieldValue property is empty or the overwrite attribute on the value element (Metadata configuration) is set to yes. In this case, if the DefaultValue property holds a valid object reference or string value, then the FieldValue property is initialized with the DefaultValue property. A null reference ( Nothing in Visual Basic) is also a valid value. On the other hand, if no default value was defined, then the Field object will initialize the FieldValue property to an empty collection for collection types, to an empty string for string types, to the default value for value types, or to a null reference ( Nothing in Visual Basic) for all other types.

Exceptions

ExceptionCondition
System.NotSupportedExceptionThe FieldValue property cannot be set when it is a collection type.
System.InvalidCastExceptionThe value cannot cast to the FieldType type.