web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Creating sales order lines is failing because document no is read only

(0) ShareShare
ReportReport
Posted on by 5

I'm integrating to BC using a tool called SmartConnect, I'm pushing Sales Orders (header) and then Sales Order Lines sequentially. 

After pushing the orders, I use the order number in our system to push the order lines, I use the order number in the field "Document No" on BC. 

For some of the items (SKUs) in the order, this works fine but for many it fails. It says the field "Document No" is read-only. The problem is, it accepts a random number of line items while rejecting the rest, and it always accept the same SKUs and reject the same.

I'm using ODataV4 APIs. What's the proper way to push the Sales Order and then Sales Order Lines? I don't want to create custom objects, it sounds like a straight integration topic, I'm not sure why BC is rejecting only specific items.

I have the same question (0)
  • Suggested answer
    Amit Baru Profile Picture
    3,043 on at

    Hi,

    Pls share the code. First check the Primary key of Table your table. Because Sales Header primary key is "Document Type" & "No." and Sales Line primary key is "Document Type", "Document No." & "Line No.".

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Mohd Ajami Profile Picture
    5 on at

    Hi Amit, I'm using a software called SmartConnect from eone solutions, it's a ready-made integration system, I don't know exactly what the code is. I know the fields that I'm mapping though.

    When creating a sales line, I fill the "Document No", "Document Type", I tried with/without putting the "Line No", it doesn't matter. In both cases it shows error:

    Control 'Document No.' is read-only. CorrelationId: xxxxxxx-xxxxxx-xxxxxx-xxxxxx.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Is this the API you are using?

    If not i would recommend you try this API

    learn.microsoft.com/.../dynamics_salesorder

  • Suggested answer
    Amit Baru Profile Picture
    3,043 on at

    Hi,

    Are you publish Sales Line page via Web service page. and also check the property  of Sales Line page.

    is it Editable or not and also check the properties AllowInsert , AllowModify..

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Suggested answer
    Mohd Ajami Profile Picture
    5 on at

    Thank you all for the help. I have fixed the issue now but it's not related to Business Central. I have tried to use BC Rest APIs directly it worked fine. I tried ODataV4 APIs, they also worked fine, I concluded it cannot be related to BC.

    My apologies for the confusion, apparently, it wasn't a BC question after all.

    Here's an update for future reference for anyone using Smart Connect (SmartConnect) from eOne Solutions.

    In Smart Connect, when creating a process (mapping), you aren't supposed to do "Sales Order" and "Sales Order Items" as 2 separate objects.

    What you should do is, select only "Sales Order" from BC objects, and click the flag "Include Linked Entities", this will detect that BC has a child object of Sales Order and will show it as "SalesOrderSalesLines" which isn't exactly an object/service in BC. Map both of these to your source fields and it will work fine.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 580 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 462 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 272 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans