Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Custom Data Entity is ...
Finance forum
Suggested answer

Custom Data Entity is empty

Posted on by 46
 Hello,
I created a custom data entity in Visual Studio using purchTable as the data source. The entity was successfully created, and I can see it listed under System administration > Workspaces > Data management > Data Entities. However, it doesn't contain any data, even though purchTable in SQL Server has plenty of data.
All steps I followed:
  1. Created a new Dynamics 365 FO project and set Synchronize database to true.
  2. Added a new Data Entity using the wizard.
  3. Set purchTable as the data source.
  4. Set Is Public to true.
  5. Built both the project and solution successfully with no errors.

    the result in postman will be like this 
    {
        "@odata.context": "https://exampleurl.axcloud.dynamics.com/data/$metadata#MyCustDataEntity",
        "value": []
    }
     
What could I be missing?


 
  • Waed Ayyad Profile Picture
    Waed Ayyad 5,884 Super User 2024 Season 2 on at
    Custom Data Entity is empty
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Waed Ayyad Profile Picture
    Waed Ayyad 5,884 Super User 2024 Season 2 on at
    Custom Data Entity is empty
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 229,133 Most Valuable Professional on at
    Custom Data Entity is empty
    You don't need to create and maintain a new entity to select just three fields. Simply use $select in your OData query. For example: https://exampleurl.axcloud.dynamics.com/data/PurchaseOrderHeadersV2?$select=PurchaseOrderNumber,OrderVendorAccountNumber.
     
    Also, if you suspect that your data entity returns no data, test just whether your entity returns data, e.g. by looking at the underlying SQL view in SQL Server Management Studio. You're currently testing a few other things as well, such as your OData query. If you test too many things at once, you then don't know where the problem lies.
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,157 Super User 2024 Season 2 on at
    Custom Data Entity is empty
    Hi D365FO Junior dev,
     
    If you go to SQL and so select *from MyCustomDataEntity, does it return data?
     
    Also when you created the new entity and it's staging table, did you make sure that their labels are different than the original one, the label for both should be unique 
     
    Did you link the new entity with the new staging table by changing "Data management staging table" property on the entity?

    Also the public collection name and the public entity name should be unique and different than the original ones.
     
    Finally make sure you are using the public collection name in the url.
     
    *Note, if you only want 3 fields from PurchTable, then no need to create new entity, you can filter the url to return certain fields using $select keyword from the standard entity.
    url/data/CustomersV3?cross-company=true&$filter=dataAreaId eq 'USMF' and CustomerAccount eq 'US-01'&$select=CustomerAccount
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Custom Data Entity is empty
    Thank you

    I know there is a  standard data entity for purchtable, just I need only three columns of purchtable not all 
    this is why I tried to created that custom data entity 

    as you mentioned cross-company should be true in the url and I did but no return any data so far I think there is an issue with data entity !
     
     
     
    https://exampleurl.axcloud.dynamics.com/data/MyCustDataEntity?cross-company=true
  • Anthony Blake Profile Picture
    Anthony Blake 2,071 Super User 2024 Season 2 on at
    Custom Data Entity is empty
    To expand on everyone else's great answers, why not try your exact query against the standard purchase orders entity instead of you custom entity, to rule out a query issue?
     
    I think Layan's answer is probably the cause as you seem to have everything covered except legal entity. Try not to think of your data entity as "empty", more as not returning any data. It's more like a view than a populated element.
     
    Anthony
  • Komi Siabi Profile Picture
    Komi Siabi 12,664 Most Valuable Professional on at
    Custom Data Entity is empty
    Hi,

    Why are you using a standard table purchTable for your data entity, when the it already has one? 
    As Layan said, ensure you are in the right entity and your user has access to a valid entity.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,582 Super User 2024 Season 1 on at
    Custom Data Entity is empty
    Did you specify cross company filter in odata query? It can be the scenario that may be in the user related dataareaid, data is not available.
     
    Please make sure that you have specified the url like this.
    http://[baseURI\]/data/FleetCustomers?cross-company=true
     
    For more details check this.
     
    https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/odata
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,157 Super User 2024 Season 2 on at
    Custom Data Entity is empty
    Hi,

    It could be because of the legal entity, by default if you don't specify the dataAreaId, then it will take the user legal entity. So make sure you use "cross-company" and specify the dataAreaId where you want to get the data from.

    Example:
    url/data/CustomersV3?cross-company=true&$filter=dataAreaId eq 'USMF' and CustomerAccount eq 'US-01'

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future

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

News and Announcements

Give Back to the Community this Month

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,133 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans