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

Batch updating records without primary id gives no error, yet doesn't work #211

Closed TarogStar closed 7 months ago

TarogStar commented 7 months ago

[Write any error info to resolve easier] I've tried updating batches of records and they won't update, it speeds through them and says everything is successful. When I switch Batch size to 1 I get this error. The problem was that my query didn't include the primary id listed in the fetchxml. This should have come up initially before even trying to update the records if the Id is not specified.

System.ServiceModel.FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault>:
Entity Id must be specified for Operation
Bulk Data Updater

Server stack trace: 
- System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
- System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
- System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
- System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

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

rappen commented 7 months ago

Thanks, I'm on it. Or rather, it is fixed already. Next release is published "soon".

rappen commented 7 months ago

Fixed here: https://github.com/rappen/BulkDataUpdater/commit/8bd7429d4245eb83285da99318b5ee6e44bd077b Then move the code to: https://github.com/rappen/Rappen.XTB.Helper/blob/main/Rappen.XTB.Helpers/Extensions/QueryExtensions.cs

rappen commented 7 months ago

Related to #174