创建: 继承自, Microsoft.Crm.Sdk.IPlugin
引用: SDK/ Bin / microsoft.crm.sdk.dll 及 SDK/ Bin / microsoft.crm.sdktypeproxy.dll
例:
using Microsoft.Crm.Sdk;
using Microsoft.Crm.Sdk.Query;
using Microsoft.Crm.SdkTypeProxy;
namespace Sms.Crm4
{
public class SendSMS : Microsoft.Crm.Sdk.IPlugin
{
}
}
plugin的两个context(IPluginExecutionContext) 常用方法:
CreateCrmService
CreateMetadataService
When a value of false is passed to the CreateCrmService method or the CreateMetadataService method, the platform uses the built-in "system" account to execute Web service method calls made by your plug-in code. The "system" account is a high privilege user account with some restrictions. For example, the "system" account cannot create a task activity.
plugin的构造函数:
(string unsecure, string secure)
The first string parameter of the constructor contains public (unsecure) information. The second string parameter contains non-public (secure) information. However, the secure string is not passed to a plug-in that executes while offline.
几个plugins:
http://mscrmplugins.codeplex.com/
http://crmanalytics.codeplex.com/