Context’s InputParameters and InvalidPluginExecutionException

Hi,

This is something peculiar i found while throwing the InvalidPluginExecutionException for a pre-update plugin.

In our plugin as usual we will first convert the Target InputParameter property to DynamicEntity,

DynamicEntity entity = (DynamicEntity)context.InputParameters.Properties["Target"];

Ideally for a pre-update event, the inputparameters should contain only those attributes whose values have been modified.

For e.g. if i change the value for Salutation and FirstName field in the Contact form, i will get the following attributes in the InputParameter.

input

However if we throw InvalidPluginExecutionException and try to save the form again, we would receive almost all the attributes passed into inputparameters property bag.

input1

This is something we should be aware of while using InvalidPluginExectuionException.

Bye..


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s