Skip to main content

Notifications

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)

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans