IPLUGIN INTERFACE IN DYNAMICS CRM PLUGINS
The first and mandatory Interface we require to start plugin is IPlugin Interface.What is IPlugin Interface?
IPlugin is the base interface for plugins in Dynamics CRM. After Adding SDK reference the first step we need to do is to inherit IPlugin interface.
We can inherit it by adding : IPlugin with our plugin class name
Example- public class MyPlugin : IPlugin
It is available at
Namespace: Microsoft.Xrm.Sdk
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
Syntax for Iplugin
public interface IPlugin
IPlugin contains one method i.e Execute , Since if we are inheriting any interface in our code, we need to implement or we need to provide definition to all its method.
So it is mandatory to define Execute method.
Syntax for Execute method
public void Execute(IServiceProvider serviceProvider)
Parameters for Execute method
The parameter we pass in Execute method is type of IServiceProvider which is coming from System namespace .
A container for service objects. Contains references to the plug-in execution context (IPluginExecutionContext), tracing service (ITracingService), organization service (IOrganizationServiceFactory), and notification service (IServiceEndpointNotificationService).IExecute method is called by the event execution pipeline during processing of a message request for which the plugin is registered.
If you have further queries/seek clarification, please do let me know.Also, please do not forget to share your valuable feedback. It means a lot to me.1 Percent better Every day.



Thanks for the valuable information.Could you pease also explain/write a plug-in code for updating/Delete..it's so helpful ...thank u
ReplyDelete