Asynchoronously looks up simple contact entries.

Namespace: ININ.IceLib.People
Assembly: ININ.IceLib.People (in ININ.IceLib.People.dll) Version: 0.0.0.0 (22.3.0.218)

Syntax

C#
public void GetLookupEntriesAsync(
	IEnumerable<LookupEntryType> directoriesToSearch,
	IEnumerable<LookupEntryProperty> columnsToMatch,
	LookupComparisonType comparisonType,
	string lookupString,
	int maxEntries,
	EventHandler<GetLookupEntriesCompletedEventArgs> completedCallback,
	Object userState
)
Visual Basic
Public Sub GetLookupEntriesAsync ( _
	directoriesToSearch As IEnumerable(Of LookupEntryType), _
	columnsToMatch As IEnumerable(Of LookupEntryProperty), _
	comparisonType As LookupComparisonType, _
	lookupString As String, _
	maxEntries As Integer, _
	completedCallback As EventHandler(Of GetLookupEntriesCompletedEventArgs), _
	userState As Object _
)

Parameters

directoriesToSearch
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'LookupEntryType>)>)>
The directories to search.
columnsToMatch
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'LookupEntryProperty>)>)>
The columns to match with the lookupString, using the specified comparisonType.
comparisonType
Type: ININ.IceLib.People..::..LookupComparisonType
The comparison type.
lookupString
Type: System..::..String
The lookup string that the server needs to match.
maxEntries
Type: System..::..Int32
The maximum number of lookup entries that the application would like to receive.
completedCallback
Type: System..::..EventHandler<(Of <(<'GetLookupEntriesCompletedEventArgs>)>)>
The callback to invoke when the asynchronous operation completes.
userState
Type: System..::..Object
An optional object that contains state information for this request. This object is a way for the caller to store context information which will be provided to the AsyncCompleted event. If no context information is desired then nullNothingnullptra null reference (Nothing in Visual Basic) may be supplied.

Remarks

The logged in user must have the appropriate search rights configured in Interaction Administrator for results to be included. These search rights can be found in the Access Control container under the Search column.

When specifying AttendantProfile, attendant profiles can only be included in the lookup results if the logged in user has the sufficient search rights assigned. From within Interaction Administrator, the logged in user must have the search rights for the appropriate Email/Inbound/Operator/Outbound profiles set in the Access Control container. Additionally, the attendant profile must also be setup to be a transfer target from within Interaction Attendant.

When completed, the completedCallback delegate is invoked on a thread appropriate to the application-model, such as the GUI thread in a UI application. The Error property of the AsyncCompletedEventArgs-derived object passed to the delegate will contain any exceptions thrown while executing the asynchronous task. See the synchronous version of this method for more detailed error information. For more information on async method calls, see How Async Calls Work.

This can be used to search for contacts for operations such as transfering an Interaction.

Examples

CopyC#
using ININ.IceLib.People;
PeopleManager peopleManager = PeopleManager.GetInstance(session);

LookupEntryType[] directoriesToSearch = {LookupEntryType.User};
LookupEntryProperty[] columnsToMatch = {LookupEntryProperty.DisplayName,
                                        LookupEntryProperty.Extension};
string lookupString = "John";

peopleManager.GetLookupEntriesAsync(directoriesToSearch, columnsToMatch, LookupComparisonType.StartsWith, lookupString, 50, LookupCompletedCallback, GetNextSequenceNumber());

private void LookupCompletedCallback(object sender, GetLookupEntriesCompletedEventArgs eventArgs)
{
    if (eventArgs.Error != null )// failed. handle the failure.
    {
    }
    else
    {
        int sequenceNumber = eventArgs.UserState as int;
        if ( sequenceNumber != GetCurrentSequenceNumber() ) // another call to GetLookupEntriesAsync happened by the time our function completed. Ignore this old result (maybe).
        {
            return;
        }

        LookupEntriesDetails result = eventArgs.LookupEntriesDetails;
        // handle the result
    }
}

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionA parameter is nullNothingnullptra null reference (Nothing in Visual Basic).
System..::..ArgumentExceptionA parameter is empty.

Version Information

Supported for IC Server version 2015 R1 and beyond.
For 4.0, supported for IC Server version 4.0 GA and beyond.
For 3.0, supported for IC Server version 3.0 SU 1 and beyond.

See Also