Possible bug in standard API v2.0 after upgrading to version 22
One of our customers can’t create new sales orders with the API after upgrading to version 22 in a sandbox. It looks like when we do deep insert it wants to modify the systemId for some reason. The issue disappears if we remove field "sequence" from our salesOrderLines so something goes wrong when we specify the lineNo while creating new orders.
Endpoint used POST: https://api.businesscentral.dynamics.com/v2.0/{{tenantId}}/{{environment}}/api/v2.0/companies(e9977d19-b8cb-ec11-8e7e-0022489e8f10)/salesOrders
Body { "number": "SE1339", "externalDocumentNumber": "24124", "orderDate": "2023-04-17", "customerNumber": "300326", "currencyCode": "SEK", "pricesIncludeTax": false, "phoneNumber": "00000000000", "email": "[email protected]", "salesOrderLines": [ { "sequence": 10000, "lineType": "Item", "lineObjectNumber": "XWJA0020202M-004", "description": "Test", "unitOfMeasureCode": "STYCK", "quantity": 1, "unitPrice": 895.50 } ] }
Error { "error": { "code": "Internal_ServerError", "message": "You cannot change the value of the SystemId field.\r\n\r\nTable: Sales Line\r\n\r\nIdentification fields and values:\r\nDocument Type='Order',Document No.='SE1339',Line No.='10000' CorrelationId: 36c1f250-2bb7-4eb7-ad57-87c3909a628e." } }
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 55559.