Is there a way to change the EnforceStateTransitions (AKA Enable Status Reason Transitions checkbox on the UI) of an entity through the API in the current version (9.x) of Dynamics365 CRM Online?
I need to do disable it and re-enable on a number of entities for doing batch import.
EntityMetadata.EnforceStateTransitions
is readonly so it can't be done via a UpdateEntityRequest
.
The only other way I can think of is having two versions of the solution exported with the setting turned on and off and importing the correct one but that would be overkill, and probably slower than doing the changes manually.
It unfortunately looks like this is not possible. I would expect to find a message for doing this in either the Microsoft.Xrm.Sdk.Messages
or Microsoft.Crm.Sdk.Messages
namespaces, but it appears that there is no such message.
Microsoft confirms this on the EntityMetadata.EnforceStateTransitions
page:
This property can only be set using the application.
You could change your batch import job to comply with status reason transitions. Alternatively you could import a solution where EnforceStateTransitions
has been set to the correct value, as you mention.