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.
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
This behavior was reported to the product team. The response back was something to the effect that technically you shouldn’t be able to change the owner unless you are executing the plugin as administrator. None the less this caused issues in a few projects. This particular issue was supposed to be addressed in Ara (fall release). I haven’t tested it since then so I can’t confirm it is fixed.
Thanks Stephan. Please let me know if you have any updates. Now that I know it is a known issue, I will also report it again.
The answer we reviewed when it was reported is it will be fixed in Ara and they weren’t going to address it.
PS – The fix may have founds its way into a service pack. I haven’t been looking so I can’t confirm.