Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to update Purchase...
Finance forum
Answered

How to update Purchase Price Trade Agreement Item Prices via API \ Postman

Posted on by 125
 
Hi folks,
 
I have a requirement to update Purchase Price Agreement Items that are on a Posted Trade Agreement  via an API - so far I am testing in Postman.
 
I can perform the GET to see what the data looks like and retrieve the Entity key (RecordId)
 
GET: /data/OpenSalesPriceJournalLines?cross-company=true
 
I then try a PATCH:
 
PATCH: /data/PurchasePriceAgreements(RecordId=123456789)?cross-company=true
 
Body:
        {
            /Price/: 52.12
        }
 
But I keep receiving the message:
 
{
    /Message/: /No HTTP resource was found that matches the request URI 'https://xxxxxxxxxxxx/data/PurchasePriceAgreements(RecordId=123456789)?cross-company=true'. No route data was found for this request./
}
 
Is it actually possible to update the purchase price of an item on a Posted Trade Agreement?  
 
Thanks,
 
Michael
  • Michael Hutcheson Profile Picture
    Michael Hutcheson 125 on at
    How to update Purchase Price Trade Agreement Item Prices via API \ Postman
    Not sure if its a bug, but when you patch the product price, and only pass the price in the body, it sets the PriceSiteId to blank i.e. ""  - thus updating the original value to blank
  • Michael Hutcheson Profile Picture
    Michael Hutcheson 125 on at
    How to update Purchase Price Trade Agreement Item Prices via API \ Postman
    Thank you that has worked.
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 228,683 Most Valuable Professional on at
    How to update Purchase Price Trade Agreement Item Prices via API \ Postman
    You need to use two fields to identify the record: DataAreaId and RecordId, i.e. PurchasePriceAgreements(DataAreaId='abc',RecordId=123456789).

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans