RetrieveSharedPrincipalsAndAccess Message

banner art

Retrieves all of the security principals (users or teams) that have access to a lead and their access rights for the specified entity.

The relevant classes are specified in the following table.

Type Class
Request RetrieveSharedPrincipalsAndAccessRequest
Response RetrieveSharedPrincipalsAndAccessResponse
Target TargetOwned Class
Entity See below.

The following table shows the entities and target classes for this message.

Entity Target class
account TargetOwnedAccount
annotation TargetOwnedAnnotation
appointment TargetOwnedAppointment
campaign TargetOwnedCampaign
campaignactivity TargetOwnedCampaignActivity
campaignresponse TargetOwnedCampaignResponse
contact TargetOwnedContact
contract TargetOwnedContract
customeropportunityrole TargetOwnedCustomerOpportunityRole
customerrelationship TargetOwnedCustomerRelationship
email TargetOwnedEmail
fax TargetOwnedFax
incident TargetOwnedIncident
incidentresolution TargetOwnedIncidentResolution
invoice TargetOwnedInvoice
lead TargetOwnedLead
letter TargetOwnedLetter
list TargetOwnedList
opportunity TargetOwnedOpportunity
opportunityclose TargetOwnedOpportunityClose
orderclose TargetOwnedOrderClose
phonecall TargetOwnedPhoneCall
quote TargetOwnedQuote
quoteclose TargetOwnedQuoteClose
salesorder TargetOwnedSalesOrder
serviceappointment TargetOwnedServiceAppointment
template TargetOwnedTemplate
userquery TargetOwnedUserQuery
User owned custom business entities TargetOwnedX where X is the name of the entity
Dynamic entities TargetOwnedDynamic

Remarks

To perform this action, the caller must have access rights on the entity instance specified in the request class. For a list of required privileges, see RetrieveSharedPrincipalsAndAccess Privileges.

Example

The following code example shows how to use the RetrieveSharedPrincipalsAndAccess message.

[C#]
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the target object for the request.
TargetOwnedAccount target = new TargetOwnedAccount();

// Set the properties of the target object.
// EntityId is the object that access is being checked to.
target.EntityId = new Guid("6A92D3AE-A9C9-4E44-9FA6-F3D5643753C1");

// Create the request object.
RetrieveSharedPrincipalsAndAccessRequest retrieve = new RetrieveSharedPrincipalsAndAccessRequest();

// Set the properties of the request object.
retrieve.Target = target;

// Execute the request.
RetrieveSharedPrincipalsAndAccessResponse retrieved = (RetrieveSharedPrincipalsAndAccessResponse)service.Execute(retrieve);

[Visual Basic .NET]
' Set up the CRM Service.
Dim service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create the target object for the request.
Dim target As New TargetOwnedAccount()

' Set the properties of the target object.
'EntityId is the object that access is being checked to.
target.EntityId = new Guid("6A92D3AE-A9C9-4E44-9FA6-F3D5643753C1");

' Create the request object.
Dim retrieve As New RetrieveSharedPrincipalsAndAccessRequest()

' Set the properties of the request object.
retrieve.Target = target

' Execute the request.
Dim retrieved As RetrieveSharedPrincipalsAndAccessResponse = CType(service.Execute(retrieve), RetrieveSharedPrincipalsAndAccessResponse)

Related Topics

CrmService Messages

© 2007 Microsoft Corporation. All rights reserved.