1 / 33

新版 Microsft CRM 的 Customization 和 Extensibility 模型

新版 Microsft CRM 的 Customization 和 Extensibility 模型. 卢斌 Software Development Engineer Microsoft Corporation. 课程安排. 用户界面自定义 实体自定义 表单自定义 表单事件 工作流程 Callouts CRM Web Services. 用户界面自定义. 工作区个性化 利用配置文件自定义用户界面 Web 和 Outlook 客户端共享配置文件. 演 示. 个性化工作区 , 配置文件. 市场营销 市场活动 , 市场营销列表. 销售

uta
Download Presentation

新版 Microsft CRM 的 Customization 和 Extensibility 模型

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 新版Microsft CRM的Customization和Extensibility模型 卢斌 Software Development Engineer Microsoft Corporation

  2. 课程安排 • 用户界面自定义 • 实体自定义 • 表单自定义 • 表单事件 • 工作流程 • Callouts • CRMWeb Services

  3. 用户界面自定义 • 工作区个性化 • 利用配置文件自定义用户界面 • Web和Outlook客户端共享配置文件

  4. 演 示 个性化工作区, 配置文件

  5. 市场营销 市场活动, 市场营销列表 销售 客户, 联系人, 合同, 线索, 商机, 产品, 报价单, 发票, 销售宣传资料 工作区 对列, 活动,任务, 电子邮件, 信件, 传真, 电话呼叫,约会, 服务活动, 市场活动项目, 市场活动响应 服务 案例, 文章, 服务, 设备, 资源 自定义 楼房, 银行户头, … CRM实体(Entity)

  6. 自定义实体 • 创建,删除和自定义实体 • 更改名称,控制显示 • 创建和更改表单和视图 • 创建和更改属性 • 创建和更改关系 • 发布自定义项 • 导入和导出自定义项 • 便于部署

  7. 演 示 实体自定义和发布

  8. CRM表单设计工具

  9. CRM表单对象模型 • 属性 • 方法 • 访问字段 crmForm.all.{field_schema_name} • 事件 • OnLoad • OnSave • OnChange

  10. 演 示 表单自定义

  11. 工作流程规则 • 大多数CRM实体支持工作流程规则 • 客户, 合同, 案例, 线索, 发票, 等等 • 活动, 自定义实体 • 触发工作流程规则的事件 • 创建,分派,更改状态 • 手动 • 用内置的程序语言定义企业逻辑

  12. 工作流程插件 • 工作流程的扩展 • 基于.NET托管程序集 • 支持自定义实体 • 参量 • 配置文件: Workflow.config // Example: Defining a new workflow extension assembly <method name="DoAlertLead" assembly="WorkFlowDemo.dll" typename="WorkFlowDemo.AlertLead" methodname="CreateAlert"> <parameter name="leadId" datatype="lookup"entityname="lead"/> </method>

  13. 演 示 工作流程规则

  14. Pre & Post Callouts 基于.NET托管程序集 XML配置文件 支持下列事件 创建, 更新, 删除,更改状态,分派, 合并 Callouts

  15. 演 示 Callout自定义

  16. CRM Web Services MetadataService.asmx CrmService.asmx

  17. CrmService • 单一WSDL接口点 • http://<crmserver>/MSCrmServices/2006/CrmService.asmx?wsdl • 只有七个方法 • 支持所有实体 • 执行所有支持的操作

  18. CrmService: CRUD+方法 • Create System.Guid Create(BusinessEntity businessEntity) • Retrieve BusinessEntity Retrieve(string bEName, Guid bEId, ColumnSet columnset) • RetrieveMultiple BusinessEntityCollection RetrieveMultiple (QueryBase queryBase) • Fetch string Fetch (string FetchXML) • Update void Update (BusinessEntity businessEntity) • Delete void Delete (string bEName, Guid bEId )

  19. CrmService: Execute方法 • 执行企业逻辑操作 • 基于对称的请求和响应消息

  20. Create/Retrieve //One time service setup CrmService myService = new CrmService(); myService.Url = "http://<crmserver>/mscrmservices/2006/crmservice.asmx"; myService.Credentials = System.Net.CredentialCache.DefaultCredentials; //Create an Account account myAccount = new account(); myAccount.name = “Greg Bike Store"; myAccount.accountnumber = "123456"; myAccount.address1_postalcode = "98052"; myAccount.address1_city = "Redmond"; Guid myNewAccountId = myService.Create(myAccount); //Retrieve an existing contact ColumnSet myCS = new ColumnSet(); myCS.EntityName = "contact"; myCS.Attributes = new string[] { "firstname" }; BusinessEntity myContact = myService.Retrieve (“contact",g, myCS)

  21. RetrieveMultiple //One time service setup CrmService myService = new CrmService(); myService.Url = "http://<crmserver>/mscrmservices/2006/crmservice.asmx"; myService.Credentials = System.Net.CredentialCache.DefaultCredentials; //Get the my User ID WhoAmIRequest myW = new WhoAmIRequest(); WhoAmIResponse myWRes = (WhoAmIResponse)myService.Execute(myW); myID = myWRes.UserId; //Retrieve multiple records RetrieveMultipleRequest myReq = new RetrieveMultipleRequest (); myReq.Query = myQueryBase; RetrieveMultipleResponse myRes = (RetrieveMultipleResponse) myService.Execute(myReq); BusinessentityCollection myBECollection = myRes.BusinessEntityCollection;

  22. Execute //One time service setup CrmService myService = new CrmService(); myService.Url = "http://<crmserver>/mscrmservices/2006/crmservice.asmx"; myService.Credentials = System.Net.CredentialCache.DefaultCredentials; account myAccount = new account(); myAccount.name = "Greg Bike Shop"; myAccount.ownerid = new Owner(); myAccount.ownerid.type = 8; myAccount.ownerid.Value = myID; //Create a Create request message CreateRequest myRequest = new CreateRequest(); //Create the Target TargetCreateAccount myTargetAccount = new TargetCreateAccount(); myTargetAccount.account = myAccount; //Complete the Request message myRequest.Target = myTargetAccount; //Execute the request message CreateResponse myCreateRes = (CreateResponse)myService.Execute(myRequest);

  23. CRMService: DynamicEntity • 动态地访问系统和自定义实体 • DynamicEntity(动态实体)是只有实体名称和一组属性的BusinessEntity • 系统和自定义实体是有强类型属性的BusinessEntity • Web service可返回强类型的系统实体或动态实体

  24. DynamicEntity Create { //create a new instance of dynamic entity and fill its properties with Account values with type info DynamicEntity myAccount = new DynamicEntity(); myAccount.Name = "account"; CrmBoolean donotbulkemail = new CrmBoolean(); donotbulkemail.Value = true; Owner ownerid = new Owner(); ownerid.Value = CurrentUserId; ownerid.type = 8; CrmMoney creditlimit = new CrmMoney(); creditlimit.Value = 20000; myAccount.Properties = new Property[] { CreateProperty("name", "Redmond Cycle"), CreateProperty("donotbulkemail", donotbulkemail), CreateProperty("ownerid", ownerid), CreateProperty("creditlimit", creditlimit), }; //create request & response messages for entity creation through execute method TargetCreateDynamic myTarget = new TargetCreateDynamic(); myTarget.entity = myAccount; CreateRequest create = new CreateRequest(); Create.Target = myTarget; CreateResponse myResponse = (CreateResponse)Execute(create); Log.Comment("Created account {0}", myResponse.id); } { //create a new instance of dynamic entity and fill its properties //with Account values with type info private Property CreateProperty(string name, object value) { Property property = new Property(); property.Name = name; property.Value = value; return property; }

  25. DynamicEntity Retrieve { //create request message with appropriate target entity TargetRetrieveDynamic target = new TargetRetrieveDynamic(); target.EntityId = BankAccountId; target.EntityName = "My ISV"; RetrieveRequest retrieve = new RetrieveRequest(); retrieve.Target = target; //retrieve response using Dynamic Entity flag set to true ColumnSet columnSet = new ColumnSet(); columnSet.Attributes = new string [] { "bankaccountid", "name", "modifiedon" }; retrieve.ColumnSet = columnSet; retrieve.UseDynamicEntities = true; RetrieveResponse response = (RetrieveResponse) Execute(retrieve); DynamicEntity retrievedEntity = (DynamicEntity) response.BusinessEntity; //check property type for appropriate post-processing foreach (Property prop in retrievedEntity.Properties) { if (prop is DateTimeProperty) { //This is a DateTimeProperty } else if (prop is StringProperty) { //This is a string property } } }

  26. MetadataService • 访问 CRM 元数据 • 实体,属性,关系,等等 • 单一WSDL接口点 • http://<crmserver>/MSCrmServices/2006/MetadataService.asmx?wsdl • 性能优化 • 不同的方法flags来限制返回的数据量 • EntityFlags, MetadataFlags

  27. MetadataService

  28. 细列所有系统和自定义实体 MetadataService // Instantiate metadata service & retrieve entities metadata MetadataService myService = new MetadataService(); Metadata myMetadata = myService.RetrieveMetadata(MetatDataFlag.Entities); // store core and custom entities in separate ArrayLists ArrayList myCoreEntities = new ArrayList(); ArrayList myCustomEntities = new ArrayList(); foreach (EntityMetadata em in myMetadata.Entities) { if (em.IsCustomEntity) myCustomEntities.Add(em.name); else myCoreEntities.Add(em.name); }

  29. 演 示 CRM Web Services与Office集成

  30. Resources Microsoft CRM http://www.microsoft.com/china/BusinessSolutions/CRM/default.aspx Microsoft CRM SDK http://msdn.microsoft.com/library/en-us/CrmSdk1_2/htm/v1d2microsoftcrmversion12sdk.asp

  31. Your Feedbackis Important!

  32. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More Related