The default domain of the object class field.
[Visual Basic 6.0] Sub AlterDomain(
ByVal FieldName As String, _
ByVal Domain As IDomain _
)
[Visual Basic .NET] Public Sub AlterDomain ( _ ByVal FieldName As String, _ ByVal Domain As IDomain _ )
[C#] public void AlterDomain ( string FieldName, IDomain Domain );
[Java] public void alterDomain ( String FieldName, IDomain Domain ) throws IOException, AutomationException
[C++] HRESULT AlterDomain( BSTR FieldName, IDomain* Domain );
Parameters
FieldName [in]
FieldName is a parameter of type BSTR
Domain [in]
Domain is a parameter of type IDomain
Domains are used in the Geodatabase to validate the contents of fields in an object class. For example, you can use a domain to specify a valid range of values, or a valid set of values for a particular field in an object class. You can assign domains to a field in an object class at either the class level, or the subtype level. The AlterDomain method on IClassSchemaEdit allows you to set a domain for a field at the class level.
AlterDomain takes as arguments the name of the field you want to associate a domain with as a string, and the domain you are associating as an IDomain. You can get an enumeration of domains in a workspace by calling the Domains or DomainsByFieldType methods on the IWorkspaceDomains interface.
Once a domain is associated with a field in your object class, the values in that field will be validated against that domain when a row in the object class is validated with the IValidate interface, or the Validate Selection command in the Editor.
To unassociate a domain from a field, supply nothing for the IDomain parameter as in the following example:
pClassSchemaEdit.AlterDomain "SYMBOL", Nothing
IClassSchemaEdit Interface | IField Interface