Share via


Helper.FindWithKey method (WorkflowContext, Guid, SPItemKey, String, Guid, String)

Gets the item in the specified list based on the value of the field for the item in the associated list.

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

Syntax

'Declaration
Public Shared Function FindWithKey ( _
    context As WorkflowContext, _
    listId As Guid, _
    listItemSPItemKey As SPItemKey, _
    fieldNameInAssociated As String, _
    externalListId As Guid, _
    fieldNameInExternal As String _
) As SPItemKey
'Usage
Dim context As WorkflowContext
Dim listId As Guid
Dim listItemSPItemKey As SPItemKey
Dim fieldNameInAssociated As String
Dim externalListId As Guid
Dim fieldNameInExternal As String
Dim returnValue As SPItemKey

returnValue = Helper.FindWithKey(context, _
    listId, listItemSPItemKey, fieldNameInAssociated, _
    externalListId, fieldNameInExternal)
public static SPItemKey FindWithKey(
    WorkflowContext context,
    Guid listId,
    SPItemKey listItemSPItemKey,
    string fieldNameInAssociated,
    Guid externalListId,
    string fieldNameInExternal
)

Parameters

  • listId
    Type: System.Guid

    The GUID of the associated list.

  • fieldNameInAssociated
    Type: System.String

    The name of the field for the item specified by listItemSPItemKey.

  • externalListId
    Type: System.Guid

    The GUID or display name of the list to search for an item with the matching field value.

  • fieldNameInExternal
    Type: System.String

    The name of the field for the item in the list specified by externalListId.

Return value

Type: Microsoft.SharePoint.Workflow.SPItemKey
The list item found in the specified list.

Remarks

This method gets the value of the field for the item in the associated list, and then searches for an item in the specified list with the same value for the specified field.

See also

Reference

Helper class

Helper members

FindWithKey overload

Microsoft.SharePoint.WorkflowActions namespace