{Issue Resolution}Changing security attributes is not allowed in stage 20 plugins in Dynamics CRM 2015

Issue Description:

Recently in a migration project, we had a requirement to implement an override on Owner field.

We used plugins to achieve this and started getting following error message:

Changing security attributes is not allowed in stage 20 plugins.

clip_image001

Issue Resolution:

Plugin was set in Pre-Create stage.

Trying to find solutions some of the approaches that came across were:

· Turn plugin into Post-Create: This would not suit my case.

· Check plugin stage before running the assignment operation:

https://msdn.microsoft.com/en-us/library/gg327941.aspx#bkmk_PipelineStages

· Turn plugin into Pre-Validate stage.

I suggested the third route and it worked like a Charm.

CRM Tip: If you would like to understand about Pre-validation stage, here is a quick description from a great old colleague of mine: https://rajeevpentyala.com/tag/pre-validate/

Hope it helps and Happy CRMing!

Follow me on social channels:

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store: https://play.google.com/store/apps/detailsid=com.dynamicsofdynamicscrm.msdynamicsblog&hl=en