Darren Liu's Blog

Archive for February 2008

Optimizing and Maintaining Microsoft Dynamics CRM 4.0

leave a comment »

大家可能对这个有兴趣, 可以在以下连接下载:

Microsoft has recently released the "Optimizing and Maintaining Microsoft Dynamics CRM 4.0" white paper. This document details techniques, considerations, and best practices for optimizing and maintaining the performance of Microsoft Dynamics CRM 4.0 implementations.

Structured to support a tier-based optimization methodology, the paper includes a section dedicated to optimizing and maintaining each of the Client, Application, and Data tiers. For each tier, the paper addresses the relevant components of the broader implementation. This white paper also includes links to additional information and resources, such as performance enhancements, security updates, Knowledge Base articles, and related Microsoft Dynamics CRM documentation.

You can download the white paper at the following site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=ba826cee-eddf-4d6e-842d-27fd654ed893&DisplayLang=en

Advertisements

Written by darrenliu

02/27/2008 at 2:57 pm

Posted in Uncategorized

Hiding Views in CRM 4.0 Using Plug-in

leave a comment »

不知道为什么我Google 的 blog在中国不能看。

There are many new moving parts added to CRM 4.0 and I am learning something new every day from the community, the projects that I am working on and the people around me. What I have learned this week by working with Sean McNellis at Microsoft is to hide Views using a simple CRM 4.0 plug-in.

As many of you may already know that Microsoft took off the capabilities of sharing views which many people used in CRM 3.0 to hide unwanted System Views from the user’s view list. There have been many posts in the CRM newsgroup community on how to hide the views.

My colleague, Jeremy Hofmann found a clever way of hiding the views by updating a bit field in SavedQueryBase table against the MSCRM database. Unfortunately manipulating with the MSCRM database is not encouraged and also not supported by Microsoft. So what can we do?

What I have learned is that we can manipulate with the SavedQuery entity through a simple plug-in to control what shows up on the user’s view drop down list. There are many neat things that you can do through the savedquery class offered by the SDK, you can read about it in the 4.0 SDK.

In this post, I will show you how to hide some Contact System views by writing a simple plug-in. I will intercept the retrieve operation that CRM used for getting the views and then append more condition logics to the its query expression.

Before:

ScreenHunter_01 Feb. 25 22.10

C# Code:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.Sdk.Metadata;
using Microsoft.Crm.Sdk.Query;
using Microsoft.Crm.SdkTypeProxy;
using Microsoft.Crm.SdkTypeProxy.Metadata;

namespace CrmAddon.Crm.Plugin
{
public class HideContactViewsPlugin : IPlugin
{
public void Execute(IPluginExecutionContext context)
{
            // Query the SavedQueryBase table to retrieve the Query Id
Guid[] Views = new Guid[] {
new Guid("9818766E-7172-4D59-9279-013835C3DECD"), //NA-Contacts: No Orders in Last 6 Months
new Guid("9C241A33-CA0B-4E50-AE92-DB780D5B2A12"), //NA-Contacts: Responded to Campaigns in Last 6 Months
};

if (context.InputParameters != null && gHiddenViews.Length > 0)
{
if (context.InputParameters.Properties.Contains(ParameterName.Query))
{
QueryExpression qe = (QueryExpression)context.InputParameters.Properties[ParameterName.Query];

//only apply this action if the query is for 'views' or saved queries
if (qe.EntityName == "savedquery")
{
if (qe.Criteria != null)
{
if (qe.Criteria.Conditions != null)
{
                               //Append more condition logic to the default query that's used by CRM. In this case, I filtered on the savedqueryid to exclude the views from the Ids identified above.
ConditionExpression queryCondition = new ConditionExpression("savedqueryid", ConditionOperator.NotIn, Views);
qe.Criteria.Conditions.Add(queryCondition);
context.InputParameters.Properties[ParameterName.Query] = qe;
}
}
}
}
}
}
}
}
Plug-in Registration:
Message: RetrieveMultiple
Primary Entity: savedquery
Stage of Execution: Pre Stage
Execution Mode: Synchronous
Sample Registration Snapshot:
...
<Step
    CustomConfiguration = ""
    Description = "Hide Contact View Plug-in"


    FilteringAttributes = ""


    ImpersonatingUserId = ""


    InvocationSource = "0"


    MessageName = "RetrieveMultiple"


    Mode = "0"


    PluginTypeFriendlyName = "Hide Contact Views"


   PluginTypeName = "CrmAddon.Crm.Plugin.HideContactViewsPlugin"


    PrimaryEntityName = "savedquery"


    SecondaryEntityName = ""


    Stage = "10"


    SupportedDeployment = "0" >


</Step>
...

After:
image

As you can see that the "Contacts: No Orders in Last 6 Months" and "Contacts: Responded to Campaigns in Last 6 Months" views are removed from the drop down list. The new CRM 4.0 SDK is really powerful and you can definitely do more with it. E.g. hide/show the view based on the user id or team, etc…

I hope this will help you on your next CRM project. 🙂

Written by darrenliu

02/26/2008 at 3:33 pm

Posted in Uncategorized

新的 CRM 4.0 Plug-in Registration Tool V2

leave a comment »

我想大家也用过 CRM 4.0 SDK 的 plug-in registration tools 了吧,Plug-in Registration Developer Tool 和 普通的 Plug-in Registration Tool. 两个都是跟着 SDK来的。 现在有一个新的 Plug-in Registration Tool, 一定可以帮到你很大的忙。 用过这个Tool后,就不想用SDK跟来的 SDK Tools了。:)

Complete feature-set of the tool

  1. Register a pluginassembly, step and image. Validates the data before sending to CRM
  2. Update pluginassembly, step and image
  3. Unregister a pluginassembly shall cascade unregister all the children
  4. Enable, Disable a step
  5. Auto retrieve all CustomEntities information from the organization when registering the step
  6. Allows setting more values on step (e.g.: configuration, secureconfiguration, filteringattributes, etc.)
  7. Auto retrieve CustomAttributes on entity when registering images
  8. Search the pluginassembly, type, steps, images by names
  9. Visualize the status of the CRM Organization multiple views
    1. View by Assembly : What steps are registered on what plug-in
    2. View by Entity : What steps are registered on an entity(e.g.: contact)
    3. View by Message : What steps are registered on a message (e.g.: create)
  10. Shows the list of Microsoft Dynamics CRM 3.0 callouts registered in the organization
  11. Work with multiple organizations at the same time
  12. Exports the Xml in the same format that can be accepted by PluginDeveloper tool

Snapshot

可以到以下连接下载:

http://code.msdn.microsoft.com/crmplugin

Written by darrenliu

02/25/2008 at 8:35 pm

Posted in Uncategorized

Microsoft Dynamics CRM 4.0 Logical Database Diagrams

leave a comment »

微软推出了 CRM 4.0 数据库图, 图解释了每一个CRM实体的关系。大家可以参考一下。需要用 Visio 来打开。

http://www.microsoft.com/downloads/details.aspx?FamilyId=B73912E8-861E-43AE-97B4-72B3E809F287&displaylang=en

crm4answers.vsd – Shows relationship for the knowledge base and sales literature entities.

crm4casecontract.vsd – Shows relationship for the incident (case) and contract entities.

crm4cola.vsd – Shows relationships for the four key entities: account, contact, opportunity and lead.

crm4marketing.vsd – Shows relationships for the marketing automation entities.

crm4mywork.vsd – Shows relationship for the entities shown in the My Work area.

crm4productcatalog.vsd – Shows relationship for the product catalog entities.

crm4qoi.vsd – Shows relationship for the quote, salesorder (order) and invoice entities.

crm4sales.vsd – Shows relationship for the sales force automation entities.

crm4scheduling.vsd – Shows relationship for the scheduling entities.

crm4service.vsd – Shows relationship for the customer service entities

Written by darrenliu

02/20/2008 at 3:22 pm

Posted in Uncategorized

Microsoft Dynamics CRM 4.0 Logical Database Diagrams

leave a comment »

微软推出了 CRM 4.0 数据库图, 图利解释了每一个CRM实体的关系。大家可以参考一下。需要用 Visio 来打开。

http://www.microsoft.com/downloads/details.aspx?FamilyId=B73912E8-861E-43AE-97B4-72B3E809F287&displaylang=en

crm4answers.vsd – Shows relationship for the knowledge base and sales literature entities.

crm4casecontract.vsd – Shows relationship for the incident (case) and contract entities.

crm4cola.vsd – Shows relationships for the four key entities: account, contact, opportunity and lead.

crm4marketing.vsd – Shows relationships for the marketing automation entities.

crm4mywork.vsd – Shows relationship for the entities shown in the My Work area.

crm4productcatalog.vsd – Shows relationship for the product catalog entities.

crm4qoi.vsd – Shows relationship for the quote, salesorder (order) and invoice entities.

crm4sales.vsd – Shows relationship for the sales force automation entities.

crm4scheduling.vsd – Shows relationship for the scheduling entities.

crm4service.vsd – Shows relationship for the customer service entities

Written by darrenliu

02/20/2008 at 3:21 pm

Posted in Uncategorized