Changing security attributes is not allowed in stage 20 plugins.

As part of a requirement I needed to create a plugin to set the ownership of a record prior to its creation as setting it after this event would not work for what the customer needed, this means that it would run on PreOperation and subsecuently set the property OwnerId to the resulting owner that will be retrieved after certain logic. However, once I deployed it to my DEV instance I started to see the next error:

Changing security attributes is not allowed in stage 20 plugins.

How to fix

This problem relies on the fact that you can’t change some security properties in the record at the PreOperation stage, so you need to do a workaround for this. The best one I found was simply to change the stage on which the plugin was running, instead of using PreOperation you should select PreValidation.

Hope it helps!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s