Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Sales OrderDate is not what I send with SalesOrder API

Posted on by 10

Hello Community, 

I create a salesorder using API. Here is the JSON that I send to API: 

{
    "customerId": "a4df5dc2-*******-******-002248ad8355",
    "currencyCode": "USD",
    "orderDate": "2022-01-01",
    "salesOrderLines": [
        {
            "description": "SDChargeFee",
            "quantity": 1,
            "lineType": "Item"
        }
    ]
}
But, when I open business central sales order page, the OrderDate is set to today's date. This is not what I expect. Because the items that I defined in business central have various pricings based on the date. Because the salesOrder date is not set correctly, the price that business central picks for the item is not as expected. So, the question is why the salesOrder date is not what I put in API? is this a bug?
Thanks in advance, 
Categories:
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,133 Super User 2024 Season 2 on at
    RE: Sales OrderDate is not what I send with SalesOrder API

    The orderDate is mapped to the "Document Date" field of the BC Sales Header.

    Your date 2022-01-01 should be in Document Date field in the BC.

    pastedimage1672759991975v1.png

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Sales OrderDate is not what I send with SalesOrder API

    hi

    my advice is to create a page on custom staging tables Header and Rows and expose it as an API page

    on the onafter insert of the header and rows give all the controls you need and then if everything is successful create the order in AL COde.

    Daniele

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans