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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Odata Query using join

(0) ShareShare
ReportReport
Posted on by 5

Hello,
I have 2 tables coming from D365 F&O(ERP),
1. Production Order Headers (POH)
2. ProductionOrderBillofMaterialsLine (POBOML)
where POH.[ProductionOrderNumber] = POBOML.[ProductionOrderNumber] and i need to extract data only for Production Orders where POH.[Status] <> 'Completed'.
Any luck ihow we can do this using Odata. i tried dusing expand but no luck.

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Raulhumpy,

    It would be possible to develop a new data entity combining these tables and set the range on the status field. Then you have all in one data entity instead of two distinct entities.

  • Suggested answer
    Community member Profile Picture
    2 on at
    Problem I've found with ProductionOrderHeaders is that it only returns the Top Level order, so any BOM Items which have a Production Order are not returned. That said you can use $expand for your URL.
     
    https://[Your Host]/data/ProductionOrderHeaders?$filter=ProductionOrderStatus eq Microsoft.Dynamics.DataEntities.ProdStatus%27Completed%27&$expand=ProdutionOrderBOMLines
     
    Worst part about that is if you want all BOMs for all Sub-Production Orders you just can't get them. Or at least I haven't been able to figure out how to get All Production Orders.
     
    You could expand ChildProductionOrderHeaders but in my testing this just gives me the same Production Order as originally called. Example:
    https://[Your Host]/data/ProductionOrderHeaders?$filter=ProductionOrderNumber eq %27PRD000002082%27&$expand=ChildProductionOrderHeaders
     
    Returns (removed the clutter):
    {
        "@odata.context": "https://yourhost/data/$metadata#ProductionOrderHeaders",
        "value": [
            {
                "ProductionOrderNumber": "PRD000002082",
                "ChildProductionOrderHeaders": [
                    {
                        "ProductionOrderNumber": "PRD000002082",
                    }
                ]
            }
        ]
    }
     

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans