Monday, July 27, 2015

Changing security attributes is not allowed in stage 20 plugins.

I faced a strange issue with Plugin which changes the Owner of a case during pre-create, the issues details said as below "Changing security attributes is not allowed in stage 20 plugins.".

The issue seems to be an upgrade in Dynamics CRM to maintain data integrity to not allow any security related changes during pre-create.

so as a work around you have below two options

1. Move your solution to Post Create/Update,  but this will need explicit update of owner using assign request, which will trigger assign notification workflows.

Update: No more need of Assign Request if you are on latest CRM 2016 versions as this can be done via Update request

2. Move your plugin to Pre-Validation,this is a perfect replacement for the same & works as expected.!!!