This topic has not yet been rated - Rate this topic

SPField.RelatedField Property

Gets or sets the internal name of a field to which the current field is related.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public string RelatedField { get; set; }

Property Value

Type: System.String
A string that contains the name of the field to which the current field is related.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
In case of a BCS / BDC field
Could someone please delete this comment?
In case of a BCS / BDC field
Could someone please delete this comment?
SPBusinessDataField.RelatedField
The SPBusinessDataField.RelatedField property stores the name of the related field where the primary key of the business data entity is stored. The value identifies the selected item, which is displayed by the field for the current SPListItem.

The identifier is in BDC form and can be converted to the identifier(s) of the external data object with:
object[] externalId = EntityInstanceIdEncoder.DecodeEntityInstanceId((string)item[field.RelatedField]);