Search code examples
dynamics-crmdynamics-365

The Dynamics 365 plugin preimage contains the value after modification


The plugin step's message is Assign, postoperation (or preoperation, or prevalidation, the problem is still the same). When I debug the plugin in Visual Studio, the field "ownerid" of the preImage does not contain the Id of the old user, but the newly assigned one.

leadPreImage.GetAttributeValue<EntityReference>("ownerid").Id

What can be the cause of this problem?


Solution

  • AssignRequest is currently deprecated and is likely to be removed in a future release. Consider changing your plugin step to Update Message and add Owner(ownerid if looking in schema names column) as a filtering attribute for a better performance.

    I believe this will remove your issue.