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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Get only non virtual Entities using c#

(0) ShareShare
ReportReport
Posted on by 172

Hi all,

I try to get a List of Entities filtered by is not virtual. I use this but I can´t find an option to check my condition.

RetrieveAllEntitiesRequest request = new RetrieveAllEntitiesRequest();
            RetrieveAllEntitiesResponse response = new RetrieveAllEntitiesResponse();

            request.EntityFilters = EntityFilters.All;
            request.RetrieveAsIfPublished = true;

            try
            {
                response = (RetrieveAllEntitiesResponse)_service.Execute(request);
                
            } catch(Exception ex)
            {
                throw ex;
            }

Anybody an idea?

Thanks all...

I have the same question (0)
  • Daniel Schneider Profile Picture
    172 on at

    Sorry, my mistake. I only need the entities which is shown web. If i retrieve all entities I get more than 400 but in web there are not so much.

    I don´know how can I filter it by using c#.

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi,

    Please check EntityMetadata properties:

    docs.microsoft.com/.../entitymetadata

    Maybe you will find some properties that you can filter with.

  • Daniel Schneider Profile Picture
    172 on at

    Which property you mean? There are no properties what i know that can i use for filtering.

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi, 

    I use this code to retrieve all entities and filter the response in memory. For example, the sample code below displays all entities that support the creation of new forms: 

    RetrieveAllEntitiesResponse entitiesResponse = (RetrieveAllEntitiesResponse)organizationService.Execute(new RetrieveAllEntitiesRequest()
    {
        EntityFilters = EntityFilters.All,
    });
    
    IEnumerable entitiesCanCreateForms = entitiesResponse.EntityMetadata.Where(entity => entity.CanCreateForms.Value==true);
    foreach(var entity in entitiesCanCreateForms)
    {
        Console.WriteLine(entity.SchemaName "\n");
    }

    If you want to see other properties to filter with, please refer to the following link; 

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/entitymetadata?view=dynamics-ce-odata-9

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans