Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Can we create an entit...
Finance forum
Suggested answer

Can we create an entity from View

Posted on by 451

Hi,

I have a view which is having query as datasource. ( the query is bit complicated).

Now the requirement is that to have the view as a entity.

I think it is not possible to expose a view as an Odata feed /entity.

However I would like to check if it is a possibility or an alternative to this ?

Thanks,

VK

  • Komi Siabi Profile Picture
    Komi Siabi 12,377 Super User on at
    RE: Can we create an entity from View

    So smart of you Mariano.

  • RE: Can we create an entity from View

    I have done many entities wich uses views as datasource, as Martin says the wizard will complain because the view doesn't have a primary key, but what I usually do is to create the entity using the wizard an a simple standard table, choose the fields from the primary key to be added to the entity, name the entity as per your convenience, once the wizard creates all the objects change the datasource of the created entity with the view, upgrade the entity key and add the fields you need, finally upgrade the staging table. Of course, what you get is a read only entity as you're using a view, but you can still use it for OData query purposes, of for BYOD

  • Martin Dráb Profile Picture
    Martin Dráb 225,490 Super User on at
    RE: Can we create an entity from View

    Do you get any error if you actually try it? Note that you shouldn't give up if it's not supported by the wizard - it still may be possible if you do it manually.

  • vicky1234 Profile Picture
    vicky1234 451 on at
    RE: Can we create an entity from View in D365 FO

    Thanks for your reply.

    Actually what I want to understand is that is there a way to expose a complicated query/viewas a datasouce in an entity so that it can be used as read-only entity.

  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,377 Super User on at
    RE: Can we create an entity from View in D365 FO

    Hi VK,

    Just like you said, you can not see Views as datasource while creating data entities.

    You should consider using composite entities where you can bring in multiple entities.

    docs.microsoft.com/.../develop-composite-data-entities

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans