Thursday 6 December 2012

plugin using by Developer tool kit

Developer tool kit :
sdk-- tools-- developer toolkit.

we need to install the developer toolkit.
for this first we can install WIF
http://support.microsoft.com/kb/974405
we can download and install.
after that install the developer tool kit.

open the Visual Studio you will get the Dynamic crm tab.
choose the new visual studio solution template.
give the name and click on ok.
you will get the connection:
give the server name. (crmsever).
choose http or https.
default credentials.
then  select the organization and solution.
click ok.
automatically it will show the crm
right click on entity and create wrapper class ( early bound).
it will come as entity.cs near by plugin.cs.
use the namespace in using area.
select the entity where we need to create plugin.
right click and select the create plugin option.
there we need to give the plugin message.
give the signing.
click on project and deploy.

sample code :


IPluginExecutionContext context = localContext.PluginExecutionContext;
            IOrganizationService service = localContext.OrganizationService;
            var orgServiceContext = new OrganizationServiceContext(service);

            if (context.InputParameters.Contains("Target") &&
                             context.InputParameters["Target"] is Entity)
            {
                // Obtain the target entity from the input parmameters.
                Entity entity = (Entity)context.InputParameters["Target"];
                // TODO: Implement your custom Plug-in business logic.
                var newCooldrink = entity.ToEntity<new_cooldrink>();
                newCooldrink.new_productcount = 50;
            }

ref:
http://akilanaki.blogspot.in/2012/09/crm-2011-plugin-tips.html
http://blog.thinketg.com/blog/ben-klopfer/how-to-deploying-plugins-with-the-microsoft-dynamics-crm-2011-developer-toolkit-tutorial
http://blogs.msdn.com/b/crm/archive/2011/01/11/a-better-way-to-learn-linq-to-crm-linqpad-plugin-for-ms-crm-2011-is-available.aspx

No comments:

Post a Comment