Select to view content in your preferred language

How to find Destination Primary key for a non-attributed relationship definition

887
1
Jump to solution
07-12-2021 12:11 PM
KirkKuykendall1
Frequent Contributor

Hi -

I'm migrating some code from arcobjects that retrieves the Destination Primary key from IRelationshipClass2.

While the Attributed Relationship class definition has GetDestinationKeyField() member,  RelationshipclassDefinition doesn't.

Is there some way to determine DestinationKey for non-attributed relationships with Pro?

Thanks, Kirk

0 Kudos
1 Solution

Accepted Solutions
RichRuh
Esri Regular Contributor

Our names are confusing, but I think you're looking for RelationshipClassDefinition.GetOriginForeignKeyField.

For a non-attributed relationship class, the meanings of the fields are as follows:

OriginClass

The name of the origin table

DestinationClass

The name of the destination table

OriginKeyField

Primary key in the origin table

OriginForeignKeyField

The primary key in the destination table (!), which is the foreign key for the relationship

 

For attributed relationship classes, the meanings of the fields are as follows:

OriginClass

The name of the origin table

DestinationClass

The name of the destination table

OriginKeyField

Primary key in the origin table

OriginForeignKeyField

The name of the field in the attributed relationship table that corresponds to the primary key of the origin table

DestinationKeyField

The primary key in the destination table

DestinationForeignKeyField

The name of the field in the attributed relationship class table that corresponds to the primary key of the destination table

 

--Rich

 

View solution in original post

1 Reply
RichRuh
Esri Regular Contributor

Our names are confusing, but I think you're looking for RelationshipClassDefinition.GetOriginForeignKeyField.

For a non-attributed relationship class, the meanings of the fields are as follows:

OriginClass

The name of the origin table

DestinationClass

The name of the destination table

OriginKeyField

Primary key in the origin table

OriginForeignKeyField

The primary key in the destination table (!), which is the foreign key for the relationship

 

For attributed relationship classes, the meanings of the fields are as follows:

OriginClass

The name of the origin table

DestinationClass

The name of the destination table

OriginKeyField

Primary key in the origin table

OriginForeignKeyField

The name of the field in the attributed relationship table that corresponds to the primary key of the origin table

DestinationKeyField

The primary key in the destination table

DestinationForeignKeyField

The name of the field in the attributed relationship class table that corresponds to the primary key of the destination table

 

--Rich