Getting exception in OData Integration which updating Data entity at client.
I'm using the DataServiceCollection as shown below but getting exception at context.SaveChanges(SaveChangesOptions.PostOnlySetProperties).
// Assume that BatchOrder is entity name
var query = from BatchOrder in context.BatchOrders where BatchOrder.Sent == NoYes.No select BatchOrder; DataServiceCollection<BatchOrder> batchOrders = new DataServiceCollection<BatchOrder>(query); foreach (var batchOrder in batchOrders) { // do some processing on the batchOrder record here // update AX record batchOrder.Sent = NoYes.Yes;
context.UpdateObject(batchOrder); } // send changes to the AX records back to AX context.SaveChanges(SaveChangesOptions.PostOnlySetProperties); // getting exception on this line
error is like below
Message = "An error occurred while processing this request."
Response = {Microsoft.OData.Client.DataServiceResponse}
StackTrace = " at Microsoft.OData.Client.SaveResult.HandleResponse()
\r\n at Microsoft.OData.Client.BaseSaveResult.EndRequest()
\r\n at Microsoft.OData.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
\r\n at FixedAssetsIntegration...
It was working before but now it is giving error although nothing is changed, May be there is any update. Right now current Prod environment Version is: 10.0.31 (10.0.1406.165) and Platform release is PU55 (7.0.6651.135)
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156