1

CreateRequest Message is named Target,which is of type Entity.But not all Request contain a Target property is of type Entity.

For Example AssociateRequest InputParameter contains Relationship is of type Relationship.

For Example AddItem message will return which property?How should I know there are so many messages in plugin registration tool.how should I know which message has what property it will return.

it was only possible with Debugging?

Srinivas Hsk
  • 388
  • 3
  • 17

2 Answers2

1

I agree there so many messages, but I had this below file with my, while developing plugin and I look for the type of Input parameter first

I got this file from http://patrickverbeeten.com/Blog/2008/01/25/CRM-40-Plug-in-message-input-parameters

But I have tried to update this file somewhat for CRM 2011:

Please download file from:
http://tempsend.com/4C08EE4EA9

Dot_NET Pro
  • 2,095
  • 2
  • 21
  • 38
  • Thanks for the Suggesting.I downloaded that file. – Srinivas Hsk Jul 03 '14 at 09:13
  • 1
    The links above don't work anymore, but they were archived [here](http://web.archive.org/web/20121102205111/http://www.patrickverbeeten.com/Blog/2008/01/25/CRM-40-Plug-in-message-input-parameters) (the file can be downloaded through this link). – OfirD Oct 27 '16 at 09:43
0

If I understand your question correct you can just do the following:

if (context.InputParameters.Contains("Target")) {
   // Do something with Target
}
else if (context.InputParameters.Contains(“Relationship”)) {
   // Do something with Relationship
}

If you want to confirm that Target is of Entity (I think it always is in the plugin) then I would think you could just do the following:

if (context.InputParameters["Target"].GetType() == new Entity().GetType()) {

}
Campey
  • 1,108
  • 9
  • 15