Sets the default value of the
ArcGIS.Core.Data.Field at the table level if is not specified. Otherwise, sets the default value for the specific subtype code.
Modifying an existing field
private void ModifyExistingField(SchemaBuilder schemaBuilder, TableDefinition tableDefinition, string fieldNameToBeModified = "PropertyAddress")
{
Field field = tableDefinition.GetFields().FirstOrDefault(f => f.Name.Contains(fieldNameToBeModified));
// Update field's alias name and length
FieldDescription fieldDescription = new FieldDescription(field)
{
AliasName = "Physical Property Address",
Length = 50
};
// Update the default value
fieldDescription.SetDefaultValue("123 Main St");
// Enqueue modify operation
schemaBuilder.Modify(new TableDescription(tableDefinition), field.Name, fieldDescription);
// Execute DDL
schemaBuilder.Build();
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.1 or higher.