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
Answered

Use Power Automate to create a Purchase Order, linked to a Purchase Agreement

(3) ShareShare
ReportReport
Posted on by 47
I am experimenting with using Power Automate to create Purchase Orders in D365 FO. I have been successful in getting it to create a Purchase Order Header record and then create Purchase Order Line records within the created PO by using the Create a record option on the PurchaseOrderHeadersV2 & PurchaseOrderLinesV2 entities. As part of both of these, I am designating a Purchase Agreement & Purchase Agreement line to link to. When the purchase order is generated, the Purchase Order Line does show it is attached to the correct PA & line. The problem is that when I navigate to that Purchase Agreement, it does not show any linkage to this new PO, and the quantity is not changed. 
 
So, it is creating the data correctly in the PO to appear to be linked to the PA, but that actual link does not seem to be occurring between the PO that Power Automate is creating, and the existing Purchase Agreement in the system. I am not sure if I am approaching this incorrectly/ missing a step, or if what I am doing is not possible through Power Automate.
 
Does anyone have experience with this, or can provide some guidance on what I am trying to accomplish?
  • Verified answer
    Jonas "Jones" Melgaard Profile Picture
    3,510 Super User 2025 Season 1 on at
    Use Power Automate to create a Purchase Order, linked to a Purchase Agreement
    Don't mind the AI answer; It looks like a result of GPT hallucination. 
     
    As Adis said, there is no possibility to create release orders without doing customizations. The logic is not exposed as an API.
     
    Looking at the release order creation code, it's a fairly easy customization to make, so I would not be too concerned about it.
     
    On as side note, there is the new "contract lifecycle management" integration. I'm not sure it will solve your need, but regardless it's an interesting read: https://learn.microsoft.com/en-us/dynamics365/supply-chain/procurement/contract-lifecycle-management/clm-overview
     
     
  • Suggested answer
    Saif Ali Sabri Profile Picture
    1,932 Super User 2025 Season 1 on at
    Use Power Automate to create a Purchase Order, linked to a Purchase Agreement
    The issue is that while your Power Automate flow successfully assigns the Purchase Agreement (PA) and PA Line to the Purchase Order (PO), it does not trigger the system logic required to update the PA quantities and link the PO back to the PA.
    Solution:
    1. Use the "Confirm" Action on the PO
      • After creating the PO Header and Lines, use the "Update a record" action in Power Automate on the PurchaseOrderHeadersV2 entity.
      • Set the DocumentState field to "Confirmed" to trigger standard D365 logic.
    2. Ensure the PO is Released from the PA
      • When creating the PO, set the IsReleasedFromAgreement field to true on the PurchaseOrderHeadersV2 entity.
      • Ensure the PurchaseAgreementId and PurchaseAgreementLineId are correctly mapped.
    3. Trigger the Standard PA Update Process
      • If the above steps don't work, consider running the "Release order from purchase agreement" process via a custom Power Automate flow or a D365 batch job.
    Summary:
    Manually linking the PO to the PA without triggering D365’s standard release logic prevents the PA from recognizing the PO. Ensuring the PO is confirmed and properly marked as released from the PA should resolve the issue.
  • Adis Profile Picture
    3,662 Super User 2025 Season 1 on at
    Use Power Automate to create a Purchase Order, linked to a Purchase Agreement
    Hi,
     
    It seems that there is a missing business logic from D365FO side when linking PA and PO through the entity. I am not sure if that is an issue on D365 side or on the entity. However, in both cases you would need a developer to investigate this. 
     
    You can only check if there is another entity in Power Automate to link PA and PO, if not then a developer may assist or another Community user who knows the answer straight away.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans