Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Create Trade Agreement...
Finance forum
Answered

Create Trade Agreement Journal Lines

Posted on by 125
Hi all,
 
I am trying to create Trade Agreement Journal Lines in D365 FO via a REST APIs - currently I'm testing in Postman.
 
I can successfully create the Journal Header and retrieve the Journal Number by performing:
 
POST: /data/TradeAgreementJournalHeaders?cross-company=true
 
And in the body I put:
 
        {
            /dataAreaId/: /A123/,
            /JournalDescription/: /Purchase Price Test/,
            /DefaultTradeAgreementType/: /Purch/,
            /TradeAgreementJournalNameId/: /P_Price/
        }
In the response I receive the newly created Journal Number that I will pass in the Journal Line.
 
But which Entity do I POST to then create the Lines?  I've had a look at the below Entities via Postman but they do not contain Trade Agreement Journal Lines:
 
 
Can anyone assist or point me in the right direction?
  • Michael Hutcheson Profile Picture
    Michael Hutcheson 125 on at
    Create Trade Agreement Journal Lines
    Hello Anthony,
     
    That has worked thank you, and thanks for the tip that is useful to know.
     
    Regards,
     
    Michael
  • Verified answer
    Anthony Blake Profile Picture
    Anthony Blake 1,823 Super User 2024 Season 2 on at
    Create Trade Agreement Journal Lines
    Add the letter s to the end:
     
    OpenSalesPriceJournalLines
    OpenPurchasePriceJournalLines
     
    If your ever looking for exactly what's available in your environment by the way, query the data endpoint without any criteria, and the response will contain all available entities:
     
    https://xxxxxxxxxxxxx/data

    e.g.
    ...
    {
          "name":"OpenPurchasePriceJournalLines","kind":"EntitySet","url":"OpenPurchasePriceJournalLines"
    }
    ​​​​​​​...
  • Michael Hutcheson Profile Picture
    Michael Hutcheson 125 on at
    Create Trade Agreement Journal Lines
    Thanks for the reply.
     
    I have tried performing a GET to the two URI's but they don't appear to exist:
     
    "Message": "No HTTP resource was found that matches the request URI 'https://xxxxxxxxxxxxx/data/OpenPurchasePriceJournalLine?cross-company=true'. No route data was found for this request."
     
    "Message": "No HTTP resource was found that matches the request URI 'https://xxxxxxxxxxxxx/data/OpenSalesPriceJournalLine?cross-company=true'. No route data was found for this request."
     
    Regards,
     
    Michael
  • Suggested answer
    Anthony Blake Profile Picture
    Anthony Blake 1,823 Super User 2024 Season 2 on at
    Create Trade Agreement Journal Lines
    Take  look at:
     
    OpenSalesPriceJournalLine
    OpenPurchasePriceJournalLine
     
    Both reference PriceDiscAdmTrans Table which is where I think you will want your lines to go.
     
    There are additional entities for discounts and multi-line discounts, all point back to PriceDiscAdmTrans Table (in the most part)
     
    OpenSalesLineDiscountJournalLine
    OpenSalesMultiLineDiscountJournalLine
    OpenSalesTotalDiscountJournalLine
     
    OpenPurchaseLineDiscountJournalLine
    OpenPurchaseMultiLineDiscountJournalLine
    OpenPurchaseTotalDiscountJournalLine
     
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,126 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans