Share via


FieldLookup.PrimaryFieldId property

Gets or sets a value that specifies the primary lookup field identifier if this is a dependent lookup field Otherwise, it is an empty string.

Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Property PrimaryFieldId As String
    Get
    Set
'Usage
Dim instance As FieldLookup
Dim value As String

value = instance.PrimaryFieldId

instance.PrimaryFieldId = value
public string PrimaryFieldId { get; set; }

Property value

Type: System.String
Returns a String instance representing the primary lookup field identifier.

Exceptions

Exception Condition
[Microsoft.SharePoint.SPException]

Not a valid GUID. Error code: -2146232832.

[System.NotSupportedException]

When the list that this field belongs to is an external list. Error code: -1.

Remarks

When you create a multiple column lookup, the primary field is the FieldLookup object that establishes the relationship with the source list. One or more secondary fields depend on the primary field for the relationship to the source list.

If the current SPFieldLookup object's IsDependentLookup property returns true, then the current object is a secondary field and its PrimaryFieldId property will return the string representation of the GUID that identifies the primary lookup field on which it depends.

See also

Reference

FieldLookup class

FieldLookup members

Microsoft.SharePoint.Client namespace