Udostępnij za pośrednictwem


RetrieveUserQueuesRequest Class

Definition

Contains the data needed to retrieve all private queues of a specified user and optionally all public queues.

public ref class RetrieveUserQueuesRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class RetrieveUserQueuesRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")>]
type RetrieveUserQueuesRequest = class
    inherit OrganizationRequest
Public NotInheritable Class RetrieveUserQueuesRequest
Inherits OrganizationRequest
Inheritance
RetrieveUserQueuesRequest
Attributes

Examples

The following example shows how to use this message. For this sample to work correctly, you must have an authenticated connection to the server with a client that implements the IOrganizationService interface instance.

/// <summary>
/// Write list of user queues to the console
/// </summary>
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
static void OutputUserQueues(IOrganizationService service) {

    // Get the ID of the current user.
    Guid currentUserId = ((WhoAmIResponse)service.Execute(new WhoAmIRequest())).UserId;

    var request = new RetrieveUserQueuesRequest { 
            UserId = currentUserId,
            IncludePublic = true
    };

    var response = (RetrieveUserQueuesResponse)service.Execute(request);

    foreach (var queue in response.EntityCollection.Entities)
    {
        Console.WriteLine($"queueid:{queue["queueid"]}");
        Console.WriteLine($"name:{queue["name"]}");
        Console.WriteLine($"queueviewtype:{queue.FormattedValues["queueviewtype"]}");
        Console.WriteLine($"statecode:{queue.FormattedValues["statecode"]}");
        Console.WriteLine();
    }
}      

Example Output:

queueid:4326be43-6b69-e111-8f65-78e7d1620f5e
name:<FirstName LastName>
queueviewtype:Public
statecode:Active

queueid:5a4b76b0-dab5-4717-9743-9490f2f822c6
name:Default entity queue
queueviewtype:Public
statecode:Active

queueid:ffcb3ecb-866c-e111-b5c8-78e7d162ced1
name:Example Queue
queueviewtype:Public
statecode:Active

queueid:457dcca1-836c-e111-bbbf-78e7d1622fe5
name:Example Queue 1
queueviewtype:Public
statecode:Active

queueid:28264ef8-866c-e111-b5c8-78e7d162ced1
name:Example Queue 2
queueviewtype:Public
statecode:Active      

Remarks

For the Web API use the RetrieveUserQueues function.

Usage

Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of RetrieveUserQueuesResponse.

Privileges and Access Rights

To perform this action, the caller must have privileges on the Queue entity and access rights on the record specified in the UserId property.

Constructors

RetrieveUserQueuesRequest()

Initializes a new instance of the RetrieveUserQueuesRequest class.

Properties

ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
IncludePublic

Gets or sets whether the response should include public queues.

Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RequestId

Gets or sets the ID of the request. Optional.

(Inherited from OrganizationRequest)
RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
UserId

Gets or sets the id of the user.

Applies to