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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Unable to update DataEntity using OData

(0) ShareShare
ReportReport
Posted on by 5

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)

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans