rappen / BulkDataUpdater

Updates or touches single attributes on a set of records.
https://www.nuget.org/packages/Cinteros.XrmToolBox.BulkDataUpdater/
GNU General Public License v3.0
5 stars 5 forks source link

Entity Id must be specified for Update #174

Closed scottgolightly closed 10 months ago

scottgolightly commented 2 years ago

During an update of a boolean field earlier today I got an error from a plugin. After that error the same update statement gives me this error. I have tested the update against production (where I was updating earlier today) and our test environment with the same results. I have also tried uninstalling and reinstalling Bulk Data Updater. I have tried rebooting my system but to no avail.

image

image Error Time: 2022-09-22 16:43:23.576 System.ServiceModel.FaultException (0x80040203) Entity Id must be specified for Update mscorlib Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: at Cinteros.XTB.BulkDataUpdater.BulkDataUpdater.<>c__DisplayClass49_0.b__1(BackgroundWorker bgworker, DoWorkEventArgs workargs) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

rappen commented 2 years ago

That's bad... Can you send the query (FetchXML) that you use?

Just curious - you update 15000 records, one by one, and waiting 2 minutes between each...? That would take more that 20 days...

MscrmTools commented 1 year ago

Additional info : This error occurs if the primary key is not specified in the fetchxml.

More over, the issue occurs only if batch is set to 1. If more than one, no error is detected (but the update does not occur at all) but the tool reports success for all lines.

MscrmTools commented 10 months ago

@rappen this one seems relatively easy to fix (if not done yet): Maybe automatically add primary key attribute in fetchxml if it's not already there

rappen commented 10 months ago

The issue seems to be distinct='true' and id attribute is not included. This is now controlled when retrieving records. Note: Without distinct, the id's are always included even without the added attributed.