Share via


FieldCollection.AddDependentLookup method

Adds a secondary lookup field to a field (2) collection. A reference (3) to the SP.Field that was added is returned.

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

Syntax

'Declaration
Public Function AddDependentLookup ( _
    displayName As String, _
    primaryLookupField As Field, _
    lookupField As String _
) As Field
'Usage
Dim instance As FieldCollection
Dim displayName As String
Dim primaryLookupField As Field
Dim lookupField As String
Dim returnValue As Field

returnValue = instance.AddDependentLookup(displayName, _
    primaryLookupField, lookupField)
public Field AddDependentLookup(
    string displayName,
    Field primaryLookupField,
    string lookupField
)

Parameters

  • primaryLookupField
    Type: Microsoft.SharePoint.Client.Field

    Main lookup field to associate the dependent lookup field with. A dependent lookup field will include data from the list item referred to from the instance of the main lookup field.

  • lookupField
    Type: System.String

    Name of the field (2) from the target list (1) to include data from.

Return value

Type: Microsoft.SharePoint.Client.Field

See also

Reference

FieldCollection class

FieldCollection members

Microsoft.SharePoint.Client namespace