web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Fetch all the entity list using c#

(1) ShareShare
ReportReport
Posted on by

Hello 
i am trying to fetch all the entity using c#

public EntityMetadata[] GetEntities(IOrganizationService organizationService)
        {
            Dictionary<string, string> attributesData = new Dictionary<string, string>();
            RetrieveAllEntitiesRequest metaDataRequest = new RetrieveAllEntitiesRequest();
            RetrieveAllEntitiesResponse metaDataResponse = new RetrieveAllEntitiesResponse();
            metaDataRequest.EntityFilters = EntityFilters.Entity;

            XmlDictionaryReaderQuotas myReaderQuotas = new XmlDictionaryReaderQuotas();
            myReaderQuotas.MaxNameTableCharCount = 2147483647;
            
            // Execute the request.

            metaDataResponse = (RetrieveAllEntitiesResponse)organizationService.Execute(metaDataRequest);

            var entities = metaDataResponse.EntityMetadata;
            return entities;
        }


but it gives me error like 
Metadata contains a reference that cannot be resolved: 'sftplah.api.crm8.dynamics.com/.../Organization.svc'.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Andreas Cieslik Profile Picture
    9,267 on at

    Are you using the sample from CRM SDK? Maybe try with SDK sample as shown here to create a connection successfully and to retrieve metadata.

    https://msdn.microsoft.com/en-us/library/hh675400.aspx

  • Suggested answer
    Kantharao Profile Picture
    20 on at

    Nice post.It is working for me.

  • Suggested answer
    Kantharao Profile Picture
    20 on at

    I have not received any error.It is working as it is.Nice article.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans