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
context
Type: Microsoft.SharePoint.WorkflowActions.WorkflowContextA workflow context that contains properties that are associated with the active workflow instance.
listId
Type: System.GuidThe GUID of the associated list.
listItemSPItemKey
Type: Microsoft.SharePoint.Workflow.SPItemKeyThe item in the associated list specified by listId.
fieldNameInAssociated
Type: System.StringThe name of the field for the item specified by listItemSPItemKey.
externalListId
Type: System.GuidThe GUID or display name of the list to search for an item with the matching field value.
fieldNameInExternal
Type: System.StringThe 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.