Skip to main content

Notifications

Business Central forum

Create Sales Order Lines using Logic App Connector

Posted on by 15

Hello,

I'm using the Cronus test business central instance to test my Azure Logic App connector.  

I have successfully used the Business Central connectors to create a sales order, retrieve details of that order and get the details of a particular Item which I intend to add to that order. 

However, I am struggling to add an Item (Sales Order Line) to a Sales Order. I am getting back Bad Requests from the Business Central API.

ErrorCode: BadRequest  The key 'documentId' does not match a key for the resource 'Sales_Order_Line_Entity'.\r\nclientRequestId: c53000c0-61b5-4c5c-a505-2d3fea5226e0"
Here is my connector:
sales-lines.PNG
Here is the input of my POST to the API:
input.PNG
I added the documentId as a key in JSON and set its value to the GUID of the documentId that is returned when getting the details of the sales order I just added.
I've tried the endpoint using Postman and I'm able to create a line with the same details and sales order so it appears the details are correct.
Is there anything obvious I've missed? 
Thanks,
Nic
Categories:
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create Sales Order Lines using Logic App Connector

    Can you help me here to design logic apps for sales order using d365fo connector and pasrse via json format whose output should be successful creation of sales order header and lines in d365fo UI

  • Seiji Momoto Profile Picture
    Seiji Momoto 75 on at
    RE: Create Sales Order Lines using Logic App Connector

    I am facing the same problem and still trying to find the best place to escalate this. I would just like to post here how I do workaround by using the Flow HTTP connector:

    1. At first, create the sales order header from the default Business Central connector
    2. Afterward I retrieve the GUID of the sales order from the "Compose" connector as its inputs
    3. Call the standard API from the Flow "HTTP" connector and provide the GUID of the sales order from the previous step

    pastedimage1561982494071v2.png

    Once it ran successfully, it would give you a sales header line Id:

    pastedimage1561983095390v4.png

    I hope this workaround would be some of help to you. And I also hope strongly that the standard Business Central connector can be used as it is. I am still looking for where can I work on this problem.

    Thank you,

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans