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

SetState not works on entity type "workflow" #178

Closed danielejdm closed 5 months ago

danielejdm commented 1 year ago

I had the need to deactivate business rules (workflow category=2) in bulk. I get the following error when I try to deactivate (not for the viceversa). I developed a small Console-App to perform the same action, and with it I am able to activate and deactivate "workflows" (Workflows, Business Rules, etc...). Here a snippet from my Code

image

I am currently working on Dynamics 365 onprem v. 9.1: it can be that the reason why it is not working for me the BDU? Thanks for support


System.ServiceModel.FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault>:
**Cannot update a published workflow definition.**
mscorlib

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

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

rappen commented 8 months ago

Very very late response, sorry about that...

From next release it will be possible to update State and State Reason as well. Although, that does not help us anyway, for the workflow. I've tried both with Update in my tool and Set State, and both get a correct error message from the Dataverse, like this one:

image

Your code is exactly like mine...

Any more clues to solve this, or should we just accept what MS says?

rappen commented 5 months ago

Closing this since no response. Please reopen if needed!