Understanding inputparameters and outputparameters of plugin context in CRM4.0

I was wondering what inputparameters and outparameters are passed by the platform to the IPluginExecutionContext’s context. Just created a simple plugin and registered it for (Pre/Post)Create,Update, Delete event of lead. And debugged it in visual studio to know the values for these parameters

InputParameters will have the parameters of the request message whi ch triggered the event i.e Represents the data that was passed along with the request to the platform. It will have two keys Target and OptionalParameters

Target property will be passed as a DynamicEntity and represents the image of the data passed.

OutputParameters is populated by the platform and only contains valid data during the After

Operation stage. This will contain the properties of the response message. The most common property returned is an “id” entry that will represent the Guid. In that example, it works exactly the same way the Request will produce a Response object with an id property. You would use this value to do subsequent processing that you need the entity Id value to be able to relate data.

OutputParameters will have the properties of the response message which is returned as part of pipeline execution. It will have one key OptionalParameters.

For PreCreate

Inputparameters – Two key – Target and OptionalParameters

Target – It had 35 properties basically one for all the attributes with its corresponding values

For optional parameters it had following value
CreateDuplicatesOptionalParameters with the value as false.

For PostCreate.

InputParameters – Target – same 35 properties for each attribute.

OutputParameters – Had one key – id with values of the newly created lead.

For PreUpdate

InputParameters – It had attributes whose values have been modified , leadid (primarykey of lead) as well those attributes that have forceSubmit true.

CreateDuplicatesOptionalParameters with the value as false.

Outputparameters – Nothing in output parameters

For PostUpdate

InputParameters – It had attributes whose values have changed, leadid (primarykey of lead), as well those attributes that have forceSubmit true.

CreateDuplicatesOptionalParameters with the value as false.

Outputparameters – Nothing in output parameters.

For PreDelete

Target was of type -Microsoft.Crm.Sdk.Moniker having Id of the record to be deleted and name as entity name – lead

For create,update message Target property was -Microsoft.Crm.Sdk.DynamicEntity.

Nothing in OptionalParameters

Outputparameters – Nothing in output parameters.

For PostDelete

Target was of type –Microsoft.Crm.Sdk.Moniker having Id of the record to be deleted and name as lead

Nothing in OptionalParameters

Outputparameters – Nothing in output parameters.

 

To know more about inputparameters and outputparameters

http://www.patrickverbeeten.com/pages/ContentItemPage.aspx?id=12&item=53&p=true

Bye..


Author: Nishant Rana

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

7 thoughts on “Understanding inputparameters and outputparameters of plugin context in CRM4.0”

  1. You’re so awesome! I don’t suppose I’ve read through anything like this before.
    So good to discover someone with some unique thoughts on this issue.
    Really.. thanks for starting this up. This web site is one thing that’s needed on the
    web, someone with a bit of originality!

    Like

  2. Hi Nishant,
    Can you please send me the code for (pre/post) delete event.
    I need to prevent delete for some custom entity for some condition. I am not able to do this using jscript.
    Please if you can help me it will be appreciable.

    Thanks & Regards,
    Bhavika Patel
    bhavika.2711@gmail.com

    Like

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