Question Status

Suggested Answer
Deepak K asked a question on 28 Jan 2011 10:26 AM

How to use PreEntityImage and PostEntityImages in Plugins in CRM 5.0. I am not getting the syntax of using it .

How to get the form attributes values like lookup ,picklist ,boolean values etc. The syntax has changed in crm 2011 and they are using a collection for retrieving the attributes. I am not able to get the syntax for using  in the plugin. Please help me in getting the correct syntax in the code.

 

 

 

 

 

Reply
Suggested Answer
Scott Durow responded on 23 Aug 2014 11:58 AM

The Dynamics CRM really is your best resource for this - it has great content if you have the patience to read it and the samples are 1st class.

For a general explanation see msdn.microsoft.com/.../gg309673.aspx

Then download the sdk (www.microsoft.com/.../details.aspx) and look at the AdvancedPlugin.cs sample for syntax on using images at:

SDK\SampleCode\CS\Plug-ins

Hope this helps,

Scott

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply
Divyesh Patel responded on 23 Aug 2014 12:09 AM

Suppose you registered the Plugin and added a Image with name “PreImage ”

Entity preMessageImage;

if (context.PreEntityImages.Contains(“PreImage”) && context.PreEntityImages["PreImage"] is Entity)

{

preMessageImage = (Entity)context.PreEntityImages["PreImage"];

accountnumber = (String)preMessageImage.Attributes["accountnumber"];

}

Suppose you registered the Plugin and added a Image with name “PostImage ”

Entity postMessageImage;

if (context.PostEntityImages.Contains(“PostImage”) && context.PostEntityImages["PostImage"] is Entity)

{

postMessageImage = (Entity)context.PostEntityImages["PostImage"];

accountnumber = (String)postMessageImage.Attributes["accountnumber"];

}

Reply
Suggested Answer
Scott Durow responded on 23 Aug 2014 11:58 AM

The Dynamics CRM really is your best resource for this - it has great content if you have the patience to read it and the samples are 1st class.

For a general explanation see msdn.microsoft.com/.../gg309673.aspx

Then download the sdk (www.microsoft.com/.../details.aspx) and look at the AdvancedPlugin.cs sample for syntax on using images at:

SDK\SampleCode\CS\Plug-ins

Hope this helps,

Scott

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply