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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Error in response when sending request to create sales order lines with cross referenece number

(0) ShareShare
ReportReport
Posted on by 88

Hi Experts,

 

The situation below confuses me when I tried to send a request to create a sales order line if the line contains a cross reference number.

 

Recently, we exposed Business Central's original page of 'Sales Order Subform' as a web service for requests sending to create sales order lines.

But when the request contains a cross reference number that matched 2 records in the cross reference table, we got an error like this in the response, even though we already write unit of measure in the request which should be enough to narrow down to the only one that matched.

Our Records in Item Cross Reference Table is attached in the screenshot.

 pastedimage1623751266804v1.png

Our Request:

{
    "Document_Type": "Order",
    "Document_No": "TWH1201",
    "Line_No": 20000,
    "Type": "Item",
    "Cross_Reference_No": "1896-1",
    "Unit_of_Measure_Code": "PCS",
    "No": "1896-S"
}

Error in Response:

 

{
    "error": {
        "code": "Internal_ServerError",
        "message": "The following AL methods are limited during write transactions because one or more tables will be locked:\r\n\r\nForm.RunModal is not allowed in write transactions.\r\n\r\nCodeunit.Run is allowed in write transactions only if the return value is not used. For example, 'OK := Codeunit.Run()' is not allowed.\r\n\r\nReport.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'Report.RunModal(...,false)' is allowed.\r\n\r\nXmlPort.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'XmlPort.RunModal(...,false)' is allowed.\r\n\r\nUse the commit method to save the changes before this call, or structure the code differently.\r\n\r\nContact your application developer for further assistance.  CorrelationId:  8800a1a8-d853-4384-9a0d-cbf1a094d7ef."
    }
}

We know that if we operating this on Business Central UI, it will pop up a modal for user to select one matched item number, but we have no idea if we can skip this through web service callings.

 

If any experts that encoutered this before, we were wondering if you could tell us how we should write in request to avoid the error above.

 

Thanks in the advance!

  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    Have you tried using API? and if you run into same kind of issues then you could open a support ticket with MS

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 671 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 434 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 241 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans