- I've added Content -Type in the Header with value = multipart/mixed;boundary=batch_d63a-e9be-2927
1. what does this content type mean and what does this batch value mean d63a-e9be-2927?
- I've added this in the body ( raw - Text)
--batch_d63a-e9be-2927
Content-Type: multipart/mixed; boundary=changeset_2499-90ab-7b93
--changeset_2499-90ab-7b93
Content-Type: application/http
Content-Transfer-Encoding: binary
POST SalesOrderHeadersV2?cross-company=true HTTP/1.1
Content-ID: 1
Accept: application/json;q=0.9, */*;q=0.1
OData-Version: 4.0
Content-Type: application/json
OData-MaxVersion: 4.0
{
"dataAreaId": "usmf",
"LanguageId": "en-GB",
"CurrencyCode": "GBP",
"InvoiceCustomerAccountNumber": "us-001",
"OrderingCustomerAccountNumber": "us-001"
}
--changeset_2499-90ab-7b93--
--batch_d63a-e9be-2927
Content-Type: multipart/mixed; boundary=changeset_b573-33b2-85ff
--changeset_b573-33b2-85ff
Content-Type: application/http
Content-Transfer-Encoding: binary
POST SalesOrderLines?cross-company=true HTTP/1.1
Content-ID: 2
Accept: application/json;q=0.9, */*;q=0.1
OData-Version: 4.0
Content-Type: application/json
OData-MaxVersion: 4.0
{
"dataAreaId": "usmf",
"ItemNumber":"D0001",
"SalesPrice": 30,
"SalesUnitSymbol": "ea",
"OrderedSalesQuantity": 10
}
--changeset_b573-33b2-85ff--
2. should this create a sales order with header and lines in a single transaction, i mean if the line fails will the header fail as well?
- When i run it, the header got created succesfully, However the line failed
"error":{
"code":"","message":"An error has occurred.","innererror":{
"message":"Additional text encountered after finished reading JSON content: -. Path '', line 8, position 0.","type":"Newtonsoft.Json.JsonReaderException","stacktrace":" at Newtonsoft.Json.JsonTextReader.Read()\r\n at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataController.GetCompanyFromRequest()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataController.Post()\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.
3. how to solve this error