ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data Namespace / Table Class / GetJoin Method
Example

In This Topic
    GetJoin Method
    In This Topic
    Gets the Join object from which this joined table was created. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Join GetJoin()
    Public Function GetJoin() As Join

    Return Value

    The Join object from which this joined table was created.
    Exceptions
    ExceptionDescription
    This is not a joined table.
    A geodatabase-related exception has occurred.
    Remarks
    If IsJoinedTable returns false, calling this method will result in an exception.
    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