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 :
Finance | Project Operations, Human Resources, ...
Answered

OData Entity is not displaying Return Purchase Orders.

(0) ShareShare
ReportReport
Posted on by

Hi ,

I have created few Return Purchase Orders in Dynamics 365 Finance & Operations and i can see them when i click on 'All Purchase Orders' link in D365 F&O . But when i browse 'PurchaseOrderHeaders' Entity to see the orders data , the return orders are not getting displayed. I can only see Purchase Orders. 

https://XXX-d365-XXXXXXX.cloud.retail.dynamics.com/data/PurchaseOrderHeaders

https://XXX-d365-XXXXXXX.cloud.retail.dynamics.com/data/PurchaseOrderHeaders?$filter=PurchaseOrderNumber%20eq%20%RETURNPO1%27

I can see Return Orders are inserted into PurchTable and Purchtable is part of PurchaseOrderHeaders entity. Not sure still why the return orders are not getting displayed.

Just wondering if there is any filter at code level to just only  display Purchase Orders. if so, how to get return orders? I am trying to use Odata Service model in my project to perform some work. 

Please let me know if any one has any idea on this. 

thanks

Ramesh

I have the same question (0)
  • Verified answer
    Satish Panwar Profile Picture
    14,671 Moderator on at

    Hi Ramesh,

    If you notice the entity has range defined on the PurchaseType field and it's restricted to 'Purchase order' only.

    pastedimage1574553762813v1.png

    pastedimage1574553776877v2.png

    If you need return orders, you need to duplicate/create your own entity.

  • WillWU Profile Picture
    22,361 on at

    Hi Ramesh,

    Please duplicate a new data entity like this:

    Capture6.PNG

    Capture7.PNG

    Set the value of PurchaseType to ReturnItem.

    Refer the following link to build your new entity, then perform a database sync.

    Try to refresh the entities in Data Management and iisreset, and you will see your new entity.

    https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/build-consuming-data-entities

  • Ramesh Yaragalla Profile Picture
    on at

    Hi,

    I tried the about step, i am seeing some security error below.

    Severity Code Description Project File Line Suppression State

    Error BP Rule: [DataEntitySecurityPrivilegeCheck]:Path: [dynamics://DataEntityView/PurchPurchaseOrderHeaderEntity_custom]:DataEntitySecurityPrivilegeCheck: The data entity 'PurchPurchaseOrderHeaderEntity_custom' is not assigned to a security privilege.

    I tried build the project after that i see multiple errors. can you pl suggest.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    That's a best practice warning, not an error. For now you can ignore it, and handle it once the entity is developed and tested by you.

    You should always have security privilege for every data entity, else it can't be used by others than system administrators.

    Use cross references (right click - find references) on the standard entity to see how it's done. You also need to add your privilege(s) to duty/duties and a role. Security is a huge and importtant topic, you should search the web for dynamics 365 operations role based security.

  • Ramesh Yaragalla Profile Picture
    on at

    inally created both purchpurchaseOrderheader and purchpurchaeOrderLines custom entities, but when i join them to get header and line details

    getting below error

    <Error>

    <Message>An error has occurred.</Message>

    <ExceptionMessage>

    Could not find a property named 'PurchaseOrderLines_ReturnLines' on type 'Microsoft.Dynamics.DataEntities.PurchaseOrderHeader_PurchReturn'.

    </ExceptionMessage>

    <ExceptionType>Microsoft.OData.Core.ODataException</ExceptionType>

    <StackTrace>

    seems lines is property in header, not sure if am missing any setting here.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Are you able to join the header and lines of the standard entity?

  • Ramesh Yaragalla Profile Picture
    on at

    yes, i was able to

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans