ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data Namespace / Join Class / GetOriginTable Method
Example

In This Topic
    GetOriginTable Method
    In This Topic
    Gets the Table which corresponds to the origin table used to create the join. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Table GetOriginTable()
    Public Function GetOriginTable() As Table

    Return Value

    The Table which corresponds to the origin table of the join.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    Remarks
    If the JoinDirection property of the JoinDescription argument used to instantiate this object via Join Constructor is JoinDirection.Forward, this is the left table of the relationship class. If the property is JoinDirection.Backward, this is the right table of the relationship class.
    Example
    Getting a Table Definition from a Layer
    // GetDefinitionFromLayer - This code works even if the layer has a join to another table
    private TableDefinition GetDefinitionFromLayer(FeatureLayer featureLayer)
    {
      // Get feature class from the layer
      FeatureClass featureClass = featureLayer.GetFeatureClass();
    
      // Determine if feature class is a join
      if (featureClass.IsJoinedTable())
      {
        // Get join from feature class
        Join join = featureClass.GetJoin();
    
        // Get origin table from join
        Table originTable = join.GetOriginTable();
    
        // Return feature class definition from the join's origin table
        return originTable.GetDefinition();
      }
      else
      {
        return featureClass.GetDefinition();
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also