Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

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,

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans