Partager via


OrganizationService.Retrieve Method (String, Guid, ColumnSet)

 

Applies To: Dynamics CRM 2015

Retrieves a record. (Developer Extensions)

Namespace:   Microsoft.Xrm.Client.Services
Assembly:  Microsoft.Xrm.Client (in Microsoft.Xrm.Client.dll)

Syntax

public virtual Entity Retrieve(
    string entityName,
    Guid id,
    ColumnSet columnSet
)
public:
virtual Entity^ Retrieve(
    String^ entityName,
    Guid id,
    ColumnSet^ columnSet
)
abstract Retrieve : 
        entityName:string *
        id:Guid *
        columnSet:ColumnSet -> Entity
override Retrieve : 
        entityName:string *
        id:Guid *
        columnSet:ColumnSet -> Entity
Public Overridable Function Retrieve (
    entityName As String,
    id As Guid,
    columnSet As ColumnSet
) As Entity

Parameters

  • entityName
    Type: System.String

    Type: String. The logical name of the entity that is specified in the entityId parameter.

  • id
    Type: System.Guid

    Type: Guid. The ID of the record that you want to retrieve.

Return Value

Type: Microsoft.Xrm.Sdk.Entity

Returns the requested Entity.

Implements

IOrganizationService.Retrieve(String, Guid, ColumnSet)

Remarks

This is a wrapper for the IOrganizationService. Retrieve Method.

Message Availability

 This message works regardless whether the caller is connected to the server or offline.

Not all entity types support this message offline. See Supported Entities later in this topic.

Privileges and Access Rights

To perform this action, the caller must have privileges on the entity that is specified in the entityName parameter and access rights on the record that is specified in the id parameter. For a list of the required privileges, see Retrieve message privileges.

Notes for Callers

The returned record contains values for the specified properties in the columnSet parameter for which the calling user has access rights. Any other property values are not returned. For more information, see The security model of Microsoft Dynamics CRM 2015.

Pass null for the columnSet parameter to retrieve only the primary key. If the columnSet includes attributes where IsValidForRead is false, they are ignored. You can find this information in the metadata for your organization. See the preceding metadata browser information.

To retrieve a record and its related records in a single transaction, use the RetrieveRequest class.

You can use this method to retrieve any record of an entity that supports the Retrieve message, including custom entities.

For more information about the exceptions that can be thrown when this method is called, see Handle exceptions in your code.

Supported Entities

The following table shows the default entities that support this message. For the listed entities of this message, the Availability column shows Server if the caller must be connected to the server and shows Both if the caller can be either connected to, or disconnected from, the server.

Entity

Availability

account

Both

activitymimeattachment

Both

activitypointer

Both

annotation

Both

annualfiscalcalendar

Both

appointment

Both

asyncoperation

Both

attributemap

Server

audit

Server

bulkdeletefailure

Both

bulkdeleteoperation

Both

bulkoperation

Both

bulkoperationlog

Both

businessunit

Both

businessunitnewsarticle

Both

calendar

Both

campaign

Both

campaignactivity

Both

campaignresponse

Both

columnmapping

Both

competitor

Both

connection

Both

connectionrole

Both

connectionroleobjecttypecode

Both

constraintbasedgroup

Both

contact

Both

contract

Both

contractdetail

Both

contracttemplate

Both

customeraddress

Both

customeropportunityrole

Both

customerrelationship

Both

dependency

Server

discount

Both

discounttype

Both

displaystring

Both

duplicaterecord

Server

duplicaterule

Server

duplicaterulecondition

Server

email

Both

entitymap

Server

equipment

Both

fax

Both

fieldpermission

Server

fieldsecurityprofile

Server

fixedmonthlyfiscalcalendar

Both

goal

Both

goalrollupquery

Both

import

Both

importentitymapping

Both

importfile

Both

importjob

Both

importlog

Both

importmap

Both

incident

Both

incidentresolution

Both

invaliddependency

Server

invoice

Both

invoicedetail

Both

isvconfig

Server

kbarticle

Both

kbarticlecomment

Both

kbarticletemplate

Both

lead

Both

leadaddress

Both

letter

Both

list

Both

lookupmapping

Both

mailmergetemplate

Both

metric

Both

monthlyfiscalcalendar

Both

msdyn_postalbum

Server

msdyn_postconfig

Server

msdyn_postruleconfig

Server

opportunity

Both

opportunityclose

Both

opportunityproduct

Both

orderclose

Both

organization

Both

organizationui

Both

ownermapping

Both

phonecall

Both

picklistmapping

Both

pluginassembly

Both

plugintype

Both

plugintypestatistic

Server

post

Server

postcomment

Server

postfollow

Server

postlike

Server

pricelevel

Both

principalobjectattributeaccess

Both

privilege

Both

processsession

Both

product

Both

productpricelevel

Both

publisher

Both

publisheraddress

Server

quarterlyfiscalcalendar

Both

queue

Both

queueitem

Both

quote

Both

quoteclose

Both

quotedetail

Both

recurrencerule

Both

recurringappointmentmaster

Both

relationshiprole

Both

relationshiprolemap

Both

report

Both

reportcategory

Both

reportentity

Both

reportlink

Both

reportvisibility

Both

resource

Both

resourcegroup

Both

resourcespec

Both

role

Both

rollupfield

Both

salesliterature

Both

salesliteratureitem

Both

salesorder

Both

salesorderdetail

Both

savedquery

Both

savedqueryvisualization

Both

sdkmessage

Both

sdkmessagefilter

Both

sdkmessagepair

Both

sdkmessageprocessingstep

Both

sdkmessageprocessingstepimage

Both

sdkmessageprocessingstepsecureconfig

Server

sdkmessagerequest

Both

sdkmessagerequestfield

Both

sdkmessageresponse

Both

sdkmessageresponsefield

Both

semiannualfiscalcalendar

Both

service

Both

serviceappointment

Both

serviceendpoint

Server

sharepointdocumentlocation

Server

sharepointsite

Server

site

Both

sitemap

Both

solution

Both

solutioncomponent

Both

subject

Both

systemform

Both

systemuser

Both

task

Both

team

Both

template

Both

territory

Both

timezonedefinition

Both

timezonelocalizedname

Both

timezonerule

Both

transactioncurrency

Both

transformationmapping

Both

transformationparametermapping

Both

uom

Both

uomschedule

Both

userentityinstancedata

Both

userentityuisettings

Both

userform

Both

userquery

Both

userqueryvisualization

Both

usersettings

Both

webresource

Both

workflow

Server

workflowdependency

Server

workflowlog

Server

See Also

OrganizationService Class
Microsoft.Xrm.Client.Services Namespace
Developer extensions context object model (Dynamics CRM 2015)
Developer extensions for Microsoft Dynamics CRM 2015

Return to top

© 2017 Microsoft. All rights reserved. Copyright