Helper.FindWithKey Method (WorkflowContext, String, SPItemKey, String, String, 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, _
listIdOrName As String, _
listItemSPItemKey As SPItemKey, _
fieldNameInAssociated As String, _
externalListId As String, _
fieldNameInExternal As String _
) As SPItemKey
'Usage
Dim context As WorkflowContext
Dim listIdOrName As String
Dim listItemSPItemKey As SPItemKey
Dim fieldNameInAssociated As String
Dim externalListId As String
Dim fieldNameInExternal As String
Dim returnValue As SPItemKey
returnValue = Helper.FindWithKey(context, _
listIdOrName, listItemSPItemKey, _
fieldNameInAssociated, externalListId, _
fieldNameInExternal)
public static SPItemKey FindWithKey(
WorkflowContext context,
string listIdOrName,
SPItemKey listItemSPItemKey,
string fieldNameInAssociated,
string externalListId,
string fieldNameInExternal
)
Parameters
context
Type: Microsoft.SharePoint.WorkflowActions.WorkflowContextA workflow context that contains properties that are associated with the active workflow instance.
listIdOrName
Type: System.StringThe GUID or display name of the associated list.
listItemSPItemKey
Type: Microsoft.SharePoint.Workflow.SPItemKeyThe item in the associated list specified by listIdOrName.
fieldNameInAssociated
Type: System.StringThe name of the field for the item specified by listItemSPItemKey.
externalListId
Type: System.StringThe 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.