Return Value
The Join object from which this
joined table was created.joined table was created. This method must be called on the MCT. Use QueuedTask.Run.joined table was created.| Exception | Description |
|---|---|
| System.InvalidOperationException | This is not a joined table. |
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
{
// GetDefinitionFromLayer - This code works even if the layer has a join to another table
//Must be called within QueuedTask.Run()
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();
}
return featureClass.GetDefinition();
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)