Skip to main content

Notifications

Dynamics 365 general forum

OData $expand failing for createdby navigation property on custom entities

Posted on by Microsoft Employee

https://somefoo.bardomain.dynamics.com/api/data/v9.1/quotes(55694d63-5d4d-475e-b717-6f26f5553b2f)?$expand=createdby

This web api query (when replacing correct domain and guid) returns json for a specific quote record with a createdby object that contains all the information pertaining to the user that created the record.

https://somefoo.bardomain.dynamics.com/api/data/v9.1/biz_foo_types(292afb30-3488-4393-b91b-3f7efa498a29)?$expand=createdby

https://somefoo.bardomain.dynamics.com/api/data/v9.1/biz_bar_types(fe23ba2e-d3e5-4e3e-a171-fe735032a5b1)?$expand=createdby

The same structure query but for custom entities (I've tried a few) results in error like:

"code":"0x0","message":"Could not find a property named 'createdby' on type 'Microsoft.Dynamics.CRM.mt_foo_types'."

All of our custom entities have the createdby navigation property (automatically created by D365 if I'm not mistaken) when I look at the $metadata and when returning the records for the custom entities I can see the _createdby_value property populated with a Guid.

 Is this a known issue? Is there something that I need to do to make that relationship available via OData?

Many thanks,

James

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: OData $expand failing for createdby navigation property on custom entities

    Hi,

    Can you try adding select to read specific fields?

    org50b8451e.crm8.dynamics.com/.../msft_employees(d90e28e0-bb2c-ec11-b6e6-6045bd72faf4)

    I tried this on my trial instance for custom entity and it worked.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • MA_ Profile Picture
    MA_ 10 on at
    RE: OData $expand failing for createdby navigation property on custom entities

    Hello,

    its case-aware .. try "CreatedBy"

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: OData $expand failing for createdby navigation property on custom entities

    I should say I appreciate that I can query the user and expand the collection relationship that way it just seems odd that the properties on the quote worked one way but custom entities it seems to be lacking the same capability.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

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... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans