ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / Modify Method / Modify(TableDescription,String,FieldDescription) Method
Indicates the ArcGIS.Core.Data.Table where the field will be modified.
Indicates the ArcGIS.Core.Data.Field to be modified.
Indicates the field that will replace the old field.
Example

In This Topic
    Modify(TableDescription,String,FieldDescription) Method
    In This Topic
    Enqueue the modify operation on the object referred to by the TableDescription. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    tableDescription
    Indicates the ArcGIS.Core.Data.Table where the field will be modified.
    fieldName
    Indicates the ArcGIS.Core.Data.Field to be modified.
    fieldDescription
    Indicates the field that will replace the old field.
    Exceptions
    ExceptionDescription
    The subtypes are invalid or fieldName does not exist as a field in tableDescription.
    tableDescription, fieldName, and/or fieldDescription is null.
    Remarks

    Memory geodatabases do not support modifying field type, name, or nullable properties.

    Mobile geodatabases do not support modifying field type or length.

    The following fields cannot have their field name, type, or length changed.

    • Object ID
    • Global ID
    • Shape, Shape area, or Shape length​
    • Subtype field​
    • Relationship primary and foreign key fields​
    • Editor tracking fields​
    • Fields used in attribute rule​
    • Non-editable fields​
    • Required fields

    If the table is empty, the length can be increased or decreased​ in text fields.

    If the table is not empty, the length can only be increased in text fields.

    If the table is empty, the field type and nullable properties can be changed.

    Precision and scale cannot be modified in enterprise geodatabases​. These properties are not applicable for file, mobile, and memory geodatabases and default to 0​.

    Example
    Add relationship rules to a relationship class
    {
      Task ModifyRelationshipClassAsync(SchemaBuilder schemaBuilder, AttributedRelationshipClassDefinition attributedRelationshipClassDefinition) => QueuedTask.Run(() =>
      {
        AttributedRelationshipClassDescription attributedRelationshipClassDescription = new AttributedRelationshipClassDescription(attributedRelationshipClassDefinition);
    
        // Update the relationship split policy
        attributedRelationshipClassDescription.RelationshipSplitPolicy = RelationshipSplitPolicy.UseDefault;
    
        // Add field in the intermediate table
        attributedRelationshipClassDescription.FieldDescriptions.Add(FieldDescription.CreateIntegerField("RelationshipStatus"));
    
        // Add relationship rules based on subtypes,if available
        // Assuming origin class has subtype with code 1
        attributedRelationshipClassDescription.RelationshipRuleDescriptions.Add(
          new RelationshipRuleDescription(1, null));
    
        // Enqueue modify operation
        schemaBuilder.Modify(attributedRelationshipClassDescription);
    
        // Execute modify DDL operation
        schemaBuilder.Build();
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.1 or higher.
    See Also