This document is archived and information here might be outdated.  Recommended version.


IField.Required Property (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (GeoDatabase)  

IField.Required Property

Indicates if the field is required.

[Visual Basic .NET]
Public ReadOnly Property Required As Boolean
[C#]
public bool Required {get;}
[C++]
HRESULT get_Required(
  Boolean* IsRequired
);
[C++]

Parameters IsRequired [out, retval]
IsRequired is a parameter of type bool*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

All tables and feature classes have a set of required fields that are necessary to record the state of any particular object in the table or feature class. These required fields are automatically created when you create a new feature class or table, and cannot be deleted. Required fields may also have required properties such as its domain property. You cannot modify the required property of a required field.

For example, in a simple feature class, OID and Shape are required fields. They do have properties such as their alias and geometry type that you can modify, but these fields cannot be deleted.

The Required property only applies to changes to modifying the schema of a Field's properties or blocking it from being deleted. It has no impact on the ability to update or add\delete the values within the field.  Also, setting the Required field property to be True will block the user from deleting the field through the GUI, as well as through ArcObjects.

See Also

IField Interface

.NET Related Topics

Working with fields