Quantcast
Channel: Microsoft Dynamics CRM Team Blog
Viewing all 592 articles
Browse latest View live

Dialogs: Using Variables and Input Arguments

$
0
0

The posts Dialogs Part 1 and Dialogs Part 2 talk about the new Dialogs feature in Microsoft Dynamics CRM 2011. Dialogs support the usage of Variables and Input Arguments. In this post, I will explain what they are and some tips on using them. The Dialog designer provides a section for defining variables and input arguments as seen below:

clip_image002

Figure 1: Section for variables and input arguments.

What are Variables?

Variables are used for temporary data storage during the lifetime of a dialog. You can create a new variable by clicking on the Add hyperlink in the Variables section seen in Fig. 1. Each variable has a name, type and value. While creating a variable, you specify these properties as shown in the Fig. 2 below. Here we have created a variable called CustomerName, which will store a Single Line of Text, and has an initial default value of John Doe. The default value is the initial value of the variable.

clip_image004

Figure 2: Creating a new variable

What are Input Arguments?

Input arguments are used along with Child Dialogs. Child dialogs are used in situations in which you would like to transfer control to another dialog. The dialog which transfers control is called the Parent Dialog and the dialog which gets control is called the Child Dialog. Consider a situation that you want to create multiple dialogs where the last set of steps is the same. For such cases, it will be a good idea to create a separate child dialog which has the common steps. This way, you won’t have to edit multiple dialogs if some change is needed in the common steps. You can just change the child dialog and all the parent dialogs will not need modification. While transferring control from parent dialog to a child dialog, you might need to transfer some data. This is accomplished by using Input Arguments. While authoring a dialog, you can specify that it is a child dialog by editing the properties in Available to run section (see Fig. 1) as follows:

     - Enable the As a child process option

     - Disable the As an on-demand process option

At this time, you can create input arguments to specify what data is expected from the parent. For creating an input argument, you can click on the Add hyperlink in the Input Arguments section seen in Fig. 1. Like a variable, an input argument too has a name, type and value. The user interface to configure the properties of an input argument is very similar to the one used for creating a variable. For an input argument, the default value will be used by the child dialog in case the parent dialog does not specify a value for it.

While authoring the parent dialog, you need to link it to the child dialog. You can do this by adding a Link Child Dialog step through the designer. You can look up the child dialog to link to. Figure 3 shows a link child dialog step added at the end.

clip_image006

Figure 3: Linking to child dialog

Also, you can set the linkage properties by clicking on the Set Properties button (as seen Figure 3). In this set properties UI, you can specify the value to use for each of the input arguments. Note that you can also use a dynamic value like a variable or the value of one of the fields of the CRM record that the dialog is running on. The only caveat is that the source value should be of the same data type (or can be converted to the target data type). Figure 4 shows a sample linkage properties screen. Here the Name input argument (displayed as String_Name) is being passed the Full Name of the Primary contact associated with the current account (the account instance on which the dialog is run), the Age input argument is being passed the response that the user enters for the Request for age prompt, and the DiscountRate input argument is being passed the value of the variable DiscountRate defined in the parent dialog.

clip_image008

Figure 4: Setting properties for child dialog

Additional details

Apart from the purpose of use, variables and input arguments have common behavior in the way they are referenced in the rest of the dialog. In this section, I will go through additional details that are common to both of them. As mentioned earlier, each variable/input argument has a name, type and value.

- Name: The name of a variable or input argument must be unique within the dialog. Also, the same name cannot be given to a variable and an input argument. The name is limited to 1000 characters in length and can only have alphabets, numbers and the underscore (“_”) character.

- Type: There are three supported types for a variable or input argument. It can be a Single Line of Text, a Whole Number, or a Floating Point Number. Whole number supports values in the range of -2,147,483,648 and 2,147,483,647. Floating point number supports values in the range -100,000,000,000 and 100,000,000,000.

- Value: When creating the variable, you specify an initial default value for it. You can change its value by assigning it a result of some operation like Append With (in case of a variable to type Single Line of Text), or assigning a value typed in by the person executing the dialog. You can use/refer to the value of the variable wherever data needs to be specified: like creating/updating records and displaying prompt. You can go through the Lead Scoring sample blog for a detailed example of lead scoring which leverages variables. Though this makes more sense for variable, it applies to modifying the value of an input argument within a child dialog as well. When assigning a value to variable or input argument, the data type of the value being assigned has to be compatible with the type of the variable or input argument. Below table specifies the possible combinations:

Variable or input argument type

Supported types of values being assigned

Single Line of Text

Single Line of Text, Whole Number, and Floating Point Number

Whole Number

Whole Number, and Floating Point Number (after rounding)

Floating Point Number

Whole Number, and Floating Point Number

Gotchas

1. Be careful while deleting a variable or an input argument while authoring a dialog. If it is being referenced by some other steps (like a Prompt and Response step), then those steps will get disabled. So, it is advisable to remove the references to the variable/input argument before deleting it.

2. Once a variable or input argument has been created, you cannot change its type.

3. The link to the child dialog has to be the last step in the parent dialog. The “link child dialog” step will transfer the control to child dialog. While running the parent dialog, you will not be able to go back to the previous step (in the parent dialog) once the control is transferred to the child.

4. There is no overflow protection while using numeric variable and input arguments. This will have to be handled during authoring itself.

5. If you change the input arguments used in a child dialog after the parent has been published, then the parent dialog will not pick up the changes automatically. This may result in an error while executing the parent dialog.

Thanks for reading this post!

Rakesh Bilaney




Announcing Microsoft Dynamics CRM 2011 SDK Update 5.0.1

$
0
0

We’ve just updated the Microsoft Dynamics CRM 2011 SDK to version 5.0.1 – you’ll find it live on both the download center and on MSDN. We’re continuing to add new topics and samples, and expand on what we’ve already got. Let us know how we are doing: Send Feedback

For a complete list of changes, see the Release History on the first page, but here are a few highlights:

  • Binaries updated to the latest version
  • Samples now work on IFD deployments with improved authentication code
  • New topics, samples and walkthroughs for using the SOAP endpoint for Web resources
  • New PowerShell information and samples
  • Updates and additions based on feedback from customers and reviewers

Enjoy!

Amy Langlois



Hot off the press: Microsoft Dynamics CRM 2011 Implementation Guide

$
0
0

I’m pleased to announce that the Microsoft Dynamics CRM 2011 Implementation Guide (IG) is now available! This documentation has been the culmination of nearly 3 years of content development that included scores of bugs processed as well as outstanding effort from members across pm, test, dev, and support disciplines.

This guide contains comprehensive information about how to plan, install, and maintain Microsoft Dynamics CRM 2011. The IG consists of the following documents:

  • Planning Guide: This Microsoft Office Word document gives you the information and tools that help you get your organization ready for Microsoft Dynamics CRM 2011. It includes two main aspects of planning for a customer relationship management (CRM) system:
    • Technical: These topics focus on areas such as the supported topologies, system requirements, and technical considerations to address before you install.
    • Implementation methodology: These topics cover the business management, CRM requirements, and project management aspects that are needed when you deploy a CRM system.
  • Installing Guide: This Word document provides the information that you need to install Microsoft Dynamics CRM 2011, such as step-by-step instructions for running Setup, and command-line instructions for silent installations.
  • Operating and Maintaining Guide: This Word document gives you information about how to back up, restore, and provide data recovery for Microsoft Dynamics CRM 2011. Additionally, this guide provides troubleshooting steps for known issues.

The CRM 2011 IG is available at the following locations:

Cheers,

Matt Peart



Windows Azure AppFabric Integration with Microsoft Dynamics CRM - Step By Step

$
0
0

Microsoft Dynamics CRM 2011 provides this cool new feature called “Windows Azure AppFabric Integration with Microsoft Dynamics CRM” that would help customers integrate their CRM with their other line of business applications without having to deal with the typical issues with polling, opening up firewall etc. Please refer to the Azure Extensions for Microsoft Dynamics CRM topic in the MIcrosoft Dynamics CRM 2011 SDK for more details on this feature.

In this blog, I will guide you step by step to get you started with CRM integration with Azure AppFabric. At the end of this blog, you would know everything to get your first CRM-AppFabric sample up and running.

Pre-Requisite - Only for on-premises and IFD CRM servers:

If you are using Microsoft Dynamics CRM Online, you do not have to do this step. This has already been done for you.

If you are using an on-premises or IFD CRM server, you will need to do your one-time setup for configuring your CRM server for Azure integration. Please refer to the topic “Configure Windows Azure Integration with Microsoft Dynamics CRM” in CRM 2011 SDK to do this.

In this blog, we will start by creating an azure account, and then run the service that listens for messages from CRM, use the plugin registration tool to configure both Azure and CRM and then see it working end to end.

1) Signup for an Azure AppFabric account:

First, let’s start off by going to http://www.microsoft.com/en-us/appfabric/azure/default.aspx and sign up for an Azure account. (At the time of this article, there are trial memberships available which you can take advantage of).

2) Create a ServiceNamespace

Login to the AppFabric Developer Portal (https://appfabric.azure.com/Default.aspx) with your Azure AppFabric account.

clip_image002

In the AppFabric Developer Portal, go to “AppFabric” tab and create a new AppFabric project.

Click on the project and click “Add Service NameSpace”. Provide a string for your service namespace, pick your region, and choose the number of connections you need and click “Create”.

clip_image004

Now you will see “Activating” icon next to your service namespace. It takes a couple of minutes to get your service namespace activated, and then the status of the servicenamespace becomes “Active”.

Click on the service namespace and you can see the “Management Key” which is a secret key to access your service.

clip_image006

3) Create a service that listens for messages from CRM

Now we need to create a service that listens for messages in CRM.

Wondering how to create a service?

CRM 2011 SDK has a set of four sample listeners, each one with a different service contract. Click here for Sample Code for Microsoft Dynamics CRM and AppFabric Integration.

Alternatively, you can download the complete CRM 2011 SDK (available at http://msdn.microsoft.com/en-us/dynamics/crm/default.aspx), and you can compile one of these listeners and use them. For example, compile the TwoWayListener project (under sdk\samplecode\cs\azure\twowaylistener) and create TwoWayListener.exe.

4) Expose your Service in AppFabric and start listening for messages from CRM:

Start the listening Service. (By doing this step, you are actually hosting this service in Azure AppFabric, so that it will start listening for the messages from CRM.).

If you are using the sample listener that ships in the sdk, start TwoWayListener.exe and provide the following details (Please note that the command line parameters are the same for all sample listeners in the sdk):

Service namespace: <name of your AppFabric Service Namespace>

Service namespace issue name: owner

Service namespace issue key: <Management Key of your AppFabric Service Namespace>

Endpoint path: <A subpath where you want to expose your listener. This can be any string. Separate child paths will a “/”>

clip_image008

5) Connect to your organization using Plugin Registration Tool:

Download the CRM 2011 SDK (available at http://msdn.microsoft.com/en-us/dynamics/crm/default.aspx). Compile and launch the using Plugin Registration Tool that ships in the SDK (under sdk\tools\pluginregistration).

In the tool, click “Create New Connection”. Provide the Discovery Url, UserName, and Password, then click “Connect”. Select the target organization in the list and click “Connect”.

6) Create a Service Endpoint:

Now you need to create a service endpoint which contains all the details about the service that is listening to the messages from CRM plugins. Following are the list of fields in service endpoint.

  • Name: The name of your Azure AppFabric project.
  • Description: A description of this endpoint registration.
  • Solution Namespace: The solution namespace of your AppFabric project. Provide the name of the service namespace you created in Azure AppFabric Management Portal here.
  • Path: The URL of your AppFabric project. Provide the subpath under the service namespace where your service is listening here.
  • Contract: The endpoint contract. An AppFabric listener application must use this contract to read the posted message. You should choose the same contract that the listener is using, which in our example is TwoWay.
  • Claim: The claims to send to AppFabric. Use None for the standard claim.
  • Federated Mode: Check this box to use federated mode.

clip_image009

7) Configure ACS:

Next, you need to give permission for your CRM organization to post to your endpoint in Azure AppFabric using tools like acm.exe (this command line tool ships with Azure AppFabric Sdk).

How do I give permission? Configuring ACS? Hmm, what does that mean? Do I need to learn a brand new tool for doing all this???

Good news! Rather than using the command line tool acm.exe, plugin registration tool provides you with an easy to use, one- click setup support!

clip_image010

To give permission for your CRM organization to post to your endpoint in Azure AppFabric, all you need is the following information:

  • Management Key: This is the management key for your AppFabric solution namespace.
  • Certificate File: This is the public certificate that identifies your CRM deployment.
  • Issuer Name: This is the name used to identify your CRM deployment in addition with certificate file.

You can get the Issuer Name and can download the certificate under “Windows Azure AppFabric Issuer Certificate” section in the Developer Resources page in your CRM Organization (see the screenshot below), which opens up when you click the “Go to the Developer Resources page…” link in the same “Configure ACS” screen.

clip_image012

You can grant permissions based of one of the many claims that CRM posts to AppFabric.

The various claims posted by CRM are:

  • Organization: Name of your CRM organization
  • User: User under whose context the plugin is executing
  • InitiatingUser: User who triggered the plugin. This would be same as User claim in non-impersonation scenarios.
  • PluginAssembly: Full name of the plugin assembly posting to AppFabric. The assembly name is fully qualified if the assembly is strongly signed, otherwise it is the short name.

“Configure ACS” button in PluginRegistrationTool creates issuers, rules (based on organization claim only, since that would be the most widely used scenario), scope, tokenpolicy etc to allow CRM. After configuring, the summary of the configuration done is displayed in the textbox in “Configure ACS” screen.

Note: To create rules based on other types of claims, you need to use the acm.exe tool that ships with Azure AppFabric SDK.

8) Verify Authentication:

This queues up a system job (Async job) which checks whether this CRM organization has access to post to your service in the Azure AppFabric. Since we granted access using “Configure ACS” in the above step, the “Verify Authentication” should succeed now. If there are any failures, System Job Message will display the details.

clip_image013

9) Register a SdkMessageProcessingStep:

Now that we have registered the service endpoint, go ahead and right click the service endpoint and choose “Register New Step” from the context menu. Provide the Message, PrimaryEntity, and any other fields you need and click “Register New Step”. You can also choose to register the pre/post images if applicable.

clip_image015

10) Trigger the plugin:

Now we are all set!

Let’s login the organization using the browser, and trigger the plugin. (For example, if the plugin was registered on create of lead, let’s trigger the plugin by creating a lead).

When the plugin is triggered, it queues up a system job which posts the execution context of the message currently being processed by CRM to the AppFabric endpoint specified in the service namespace.

You can check out the status of the plugin execution in the system jobs grid. In case of external issues (like the listener is not up and running yet), these system jobs have a better reliability story through automatic retry mechanisms etc.

clip_image017

Congratulations! The context data from the plugin is now received at the listener. For the purpose of simplicity the listener in this scenario is a console application that outputs the data in the console. You can implement a more realistic listener that would fit your needs and will also integrate into your other Line of Business Applications.

clip_image019

Cheers,

Uma Maheswari Anbazhagan



Microsoft and Intel take Microsoft Dynamics CRM 2011 for a Test Drive

$
0
0

Here’s to the power of partnership.  Microsoft and Intel teamed up over the past month to test the performance of Microsoft Dynamics CRM 2011 to obtain a comparison with the figures obtained in a similar benchmark of Microsoft Dynamics CRM 4.0 Our engineers worked together to identify hardware and software bottlenecks and performed performance tuning while understanding the Mission-Critical capabilities of Intel’s  next generation Xeon 7500 series based hardware.  The prior release scaled to support 50,000 users on a single instance– and set the bar for the industry. 

In our joint benchmark, we used a Dell R910 server with Intel Nehalem-EX processors and Pliant Technology SSDs for our SQL box. The Dell R910 server had Intel Xeon 7560 with 4 socket, 8 core, with Hyper-Threading enabled, 2.27 GHz and 256GB RAM.  The detailed configuration, topology, optimizations, data profile, and test workload as well as lessons we learnt along the way on how to really get your CRM system blazing will be included in a whitepapers that we are cooking up.   This will be available to everyone in March so stay tuned!

Now, onto the results…drumroll please.

We are thrilled to announce that we reached 150,000 Concurrent Users, with an average response time of 0.40 seconds!  This demonstrates an enterprise-class ready solution, ready to take on the most challenging CRM deployments with great scalability, responsiveness, and reliability. 

This is a true testament to a great partnership that most importantly, reflects our commitment to helping customers find value.  Microsoft Dynamics CRM and Intel – the best enterprise CRM platform running on industry leading hardware.  A match made in heaven perhaps? We certainly like to think so.   

We’re proud of the team for taking on this challenge and of course we’re thrilled that we were able to surpass the record that we set last year.  Congratulations to everyone on the CRM team involved in this project, as well as our partners at Intel for your joint work in building products that deliver unrivaled industry leading performance and scalability!

Cheers,

Ahmed Bisht, Amir Jafri,  and Varun Krishna



White Paper: Microsoft Dynamics CRM 2011 Configuring Claims-based Authentication

$
0
0

image

In Microsoft Dynamics CRM 4.0, external users, who weren’t using VPN, could access the Internet via forms authentication.

Microsoft Dynamics CRM Server 2011 replaces forms authentication with claims-based authentication. This is an identity access solution designed to provide simplified user access and single sign-on access to Microsoft Dynamics CRM data.

The Microsoft Dynamics CRM 2011 Configuring Claims-based Authentication white paper covers this solution, plus you’ll learn about:

  • Installing and configuring AD FS 2.0.
  • Installing and configuring Microsoft Dynamics CRM Server 2011 claims-based authentication for internal access, external access (IFD)
  • Federation trusts, Microsoft Office Outlook connections, and other configuration considerations.

This white paper is available for download from:  Microsoft Download Center

And will soon be available for browsing on:  Microsoft TechNet

Please use the feedback link at the end of the document and let us know your thoughts.

Jim Holtzman



Fetch-Xml based Reports: Bits & Pieces

$
0
0

With Fetch-xml based reports in Microsoft Dynamics CRM 2011, users can now create custom reports in Microsoft CRM Online. The CRM Report Authoring extension for BIDS provides a rich authoring experience for creating such custom reports. Abhijit Gore has a great introduction post on authoring and updating fetch based report using BIDS. In this post, I will detail other features of fetch-xml based reports like Adding Parameters, Pre-filtering that will help you create better and effective reports.

1. Adding Parameters to a Fetch Based report:

Just like parameters in SQL queries, one can have parameters in Fetch-xml queries too. The advantage of having parameters is that their values can be set at runtime by the end user.
For example, you want to show all opportunities with Estimated Revenue greater than some value specified by the user. If you were creating the Report using BIDS with the CRM Fetch extension, you would write the following fetch-xml in the Query-Builder:

clip_image002

Parameter names need to start with “@” and their value is populated at runtime. The above query returns opportunities with EstimatedValue greater than the value of the parameter @MinEstimatedValue. Adding the parameter in the fetch query also adds the following QueryParameter and ReportParameter nodes in the RDL.

<QueryParameters>
  <QueryParameter Name="@MinEstimatedRevenue">
    <Value>=Parameters!MinEstimatedRevenue.Value</Value>
  </QueryParameter>
ryParameters>
 
rtParameters>
     <ReportParameter Name="MinEstimatedRevenue">
    <DataType>String</DataType>
    <Prompt>Min Estimated Revenue</Prompt>
  </ReportParameter>
ortParameters>

At runtime, the text from the “Prompt” node in the ReportParameter is displayed to the end user. The parameter value entered by the user is then used to populate the QueryParameter.

clip_image004

2. Pre-filtering in Fetch based reports:

One of the most useful features of Reports in CRM was to allow reports’ data to be filtered using Advanced Find functionality. Pre-filtering allows users to create context sensitive report - this post from Dana explains how pre-filters can be used for SQL based reports. But how do you add pre-filters to a fetch query? Well, it is fairly easy. All you need to do is specify an “enableprefiltering” attribute in the entity node of your fetch query. (The “prefilterparametername” attribute is optional):

 

<fetch>
      <entity name="opportunity" enableprefiltering="true" prefilterparametername="OpportunityFilter">
        <attribute name="name" />
        <attribute name="estimatedvalue" />
        <link-entity name="account" from="accountid" to="customerid" enableprefiltering="true" prefilterparametername="AccountFilter" >
        <attribute name="name" alias="accountname" />
        </link-entity>
      </entity>
</fetch>

As with parameters before, adding a pre-filter parameter in the fetch-query also requires adding a QueryParameter and ReportParameter node in the RDL.

<QueryParameters>
  <QueryParameter Name="OpportunityFilter">
    <Value>=Parameters!OpportunityFilter.Value</Value>
  </QueryParameter>
  <QueryParameter Name="AccountFilter">
    <Value>=Parameters!AccountFilter.Value</Value>
  </QueryParameter>
</QueryParameters>
 
<ReportParameters>
  <ReportParameter Name="OpportunityFilter">
    <DataType>String</DataType>
    <Prompt>Opportunity Filter</Prompt>
  </ReportParameter>
  <ReportParameter Name="AccountFilter">
    <DataType>String</DataType>
    <Prompt>Account Filter</Prompt>
  </ReportParameter>
rtParameters>

Once the report is uploaded into CRM and Run an Advanced Find dialog opens up. The pre-filter parameters are populated with fetch-xmls generated from this Advanced Find dialog.

(In BIDS, the pre-filter parameter will be visible as any another string value parameter. The expected input is a fetch-xml with filter conditions. Leaving the parameter value blank when prompted defaults it to a redundant filter - a fetch-xml that returns all attributes for all entity records).

image

3. Union Queries in Fetch based reports

The UNION operator in SQL allows you to combine two or more select statements and return the result as part of a single DataSet. The current fetch-xml schema does not have an operator that allows a similar UNION functionality. Instead, the workaround is to retrieve the results as part of different data sets.
Suppose you want names of all accounts and contacts in you organization. The SQL Query in your RDL would be:

<DataSet Name="DataSet1">
  <Query>
          <DataSourceName>SqlDataSource</DataSourceName>
          <CommandText> select fullname as name from FilteredContact UNION select name from FilteredAccount </CommandText>
        </Query>
</DataSet>
In a fetch based report, you would instead have two data sets one corresponding to each of the above select statements but using the same data source.
<DataSet Name="DataSet2">
 
    <Query>
      <DataSourceName>FetchDataSource</DataSourceName>
      <CommandText>&lt;fetch&gt; &lt;entity name="contact"&gt; &lt;attribute name="fullname" alias="name" /&gt; &lt;/entity&gt; &lt;/fetch&gt;</CommandText>
   </Query>
     </DataSet>
  <DataSet Name="DataSet3">
 
    <Query>
      <DataSourceName>FetchDataSource</DataSourceName>
      <CommandText>&lt;fetch&gt; &lt;entity name="account"&gt;  &lt;attribute name="name"/&gt; &lt;/entity&gt; &lt;/fetch&gt;</CommandText>
    </Query>
ataSet>

4. Multiple Datasets and Multivalued Parameter in Fetch based reports

Reports with multiple datasets would typically require utilizing results of one dataset in another dataset’s query. Let’s take the following example:
We want to generate a report that displays the top-15 accounts sorted by revenue and a 16th row that displays the total revenue for the rest of the accounts. We would again require two datasets – Dataset1 retrieves the top 15 records ordered by revenue while Dataset2 retrieves the TotalRevenue aggregating over all accounts except the ones from DataSet1.

<DataSet Name="DataSet1">
        <Query>
          <DataSourceName>FetchDataSource</DataSourceName>
          <CommandText>
&lt;fetch count="15"&gt;
              &lt;entity name="account" &gt;
                &lt;attribute name="accountid" /&gt;
                &lt;attribute name="name" /&gt;
                &lt;attribute name="revenue" /&gt;
                &lt;order attribute="revenue" descending="true" /&gt;
              &lt;/entity&gt;
        &lt;/fetch&gt;
    </CommandText>
  </Query>
</DataSet>
 
      <DataSet Name="DataSet2">
        <Query>
          <DataSourceName>FetchDataSource</DataSourceName>
          <CommandText>
&lt;fetch aggregate="true"&gt;
              &lt;entity name="account"&gt;
                &lt;attribute name="revenue" aggregate="sum" alias="TotalRevenue" /&gt;
                &lt;filter&gt;
                &lt;condition attribute="accountid" operator="not-in" value="@TopAccountIds"/&gt;
                &lt;/filter&gt;
              &lt;/entity&gt;
            &lt;/fetch&gt;
    </CommandText>
    <QueryParameters>
      <QueryParameter Name="@TopAccountIds">
        <Value>=Parameters!TopAccountIds.Value</Value>
      </QueryParameter>
    </QueryParameters>
  </Query>
</DataSet>
 
      <ReportParameter Name="TopAccountIds">
      <MultiValue>true</MultiValue>
      <Hidden>true</Hidden>
      <DefaultValue>
        <DataSetReference>
          <DataSetName>DataSet1</DataSetName>
          <ValueField>accountid</ValueField>
        </DataSetReference>
      </DefaultValue>
      </ReportParameter>

The Top 15 AccountIds retrieved from Dataset1 are taken in a multi-valued parameter called “TopAccountIds”. In the fetch-xml query in Dataset2, these parameter values are used as a filter to exclude accounts selected in Dataset1.

(Please note that the above multivalued parameter usage with fetch-xml will only work with the Microsoft Dynamics CRM 2011 RTM or later bits)

I hope that the above discussion helps you in authoring reports with parameters and pre-filters. In case you are experiencing issues with Microsoft Dynamics CRM 2011 Beta, please leverage the CRM Dev Forums.

Please let us know, via comments below, what topics you would like to see about CRM-Reporting in future blogs.

Cheers,

-Ankit Malpani



Recently Visited List and Sitemap Menu

$
0
0

Microsoft Dynamics CRM 2011 has some cool new feature that allow for a more efficient navigation. There is the Recently Viewed List, the Sitemap menu and the List Navigation. I love them because they make me more productive navigating CRM. Curious? Read on!

Recently Visited List

One of my favorite end user productivity features in Microsoft Dynamics CRM 2011 is the Recently Viewed list. It enables me to see all my recently visited records and views. Let’s say I am working on the “A Store” account. It’s one of my main accounts so open it a lot to capture notes, activities etc. In CRM 4.0 repeatedly opening this account, meant navigating to Accounts, finding the right view and finding the account on the view EVERY time I wanted to open it. Now with CRM 2011, after opening it at least once, I can now open the Recently Visited List and open the account record right from there! How easy is that!

clip_image002In the web client the Recently Viewed List is located in the upper right corner of the sitemap. Just click on it or hit CTRL+SHIFT+7 and the list will open. Not only can you open recently visited records from here, but you can open recently visited views. This is great if you have a couple of main views you work with most of the time.

As you are navigating CRM items are added to the Recently Visited List. The items are sorted from most recently to last recently visited. The list holds up to 40 records and 10 views, so as you are using the system “older” items will be “falling” off the list making room for more recent items.

clip_image004If you want to avoid having records or views falling off the list you can pin them by clicking on the push pin icon. That way they still move down the list as they get “old” but will remain on the list as long as you want.

The items on the list are not validated after they have been placed there. That means records that are deleted will remain on the list until they naturally “fall off”. Just don’t forget to unpin them.

clip_image006If you like this feature as much as I do, and if you are using the Microsoft Outlook Client you most likely want to use it there too. To get to the Recently Visited List in Outlook go to the File Tab and click on CRM Recent. BTW, the recently visited items will be the same ones you see when using the web client. So if you happen to use both you won’t lose your list!

Sitemap Menu

Have you ever been annoyed by the fact that when you switch between entities you always get presented with the default view, which isn’t necessarily what you wanted? Not any more! In CRM 2011 you can chose and open any view without having to open the default view first. From the sitemap menu, which you can open by clicking on the little arrow that appears when you mouse over the name, you can now pick the view you want to open directly. Or you can choose other options from the right-click menu such as opening it in a new window or copying/e-mailing a link.

The menu also has a list of Recently Visited records for that entity. It basically works the same way as I described above. The only difference is that these recently visited records are just for that particular entity. So if you look at the sitemap menu for Accounts, you will see the recently visited Accounts. If you look at the sitemap menu for Contacts, you see the recently visited Contacts and so on. This Recently Visited list can contain up to 6 recent items. Pinning does not apply here.

clip_image008

So, with these capabilities, you are now able to directly navigate to any recently visited record or view!

Cheers,

Karin Zimprich




The Power of Reports on the Dashboard

$
0
0

Dashboard is one of the powerful and highly demanded features introduced in Microsoft Dynamics CRM 2011. You can add Charts, Lists, Web Resources, and Iframes to a Dashboard to provide high level analytical view of CRM data. To understand more about Dashboards, start with this blog post.

Having Web Resources on Dashboard enriches the Dashboard capabilities and take the Dashboard to a whole new level.

One such example is to have a Web Resource to add Reports to a Dashboard.

So let's see how a Web Resource mimics as a Report Control for a Dashboard (and Entity Forms). Here are the screenshots on how it would look on Dashboard:

clip_image002

clip_image004

Install Solution

This is a one time task for System Administrator to create this Web Resource. You can install the solution from here.

This works for both User and System Dashboards. Also for both user and organization owned reports. This solution installs Web Resource(“msdyn_ReportControl”) and sample System Dashboard showing the custom Report (“My Won Vs. Lost Vs. Open Opportunities”).

Content of the Web Resource is explained in later section.

Add Report using Dashboard Designer

After you install a Solution in the system, you can add reports to a user Dashboard, system Dashboard or an Entity form.

To add Report to a User Dashboard:

  1. Go to Reports list and right click the Report that you want to add on Dashboard.

clip_image006

  1. Click on "Copy a link". It would be something like: http:<ServerAndOrgName>/crmreports/viewer/viewer.aspx?id=%7bD6EF3D47-40D5-DF11-8B26-00155D2A6D04%7d
  2. Paste the link into a text editing program such as Notepad.

Copy only the last part of the link. For example, you would copy D6EF3D47-40D5-DF11-8B26-00155D2A6D04, from the following link text,

http:<ServerAndOrgName>/crmreports/viewer/viewer.aspx?id=%7bD6EF3D47-40D5-DF11-8B26-00155D2A6D04%7d

This is the report ID.

  1. Go to Dashboards, click on New button in ribbon.

Click a template and then click Create.

  1. Click on Insert Web Resource from one of the placeholder on Dashboard designer canvas.
  2. In the Add Web Resource dialog box, in the Web Resource box, click the LookUp button and then choose “msdyn_ReportControl”.
  3. In the "Custom Parameter (data)" box, paste the report id.

If selected, clear the following check boxes:

· Restrict cross-frame scripting

· Pass record object-type code and unique identifier as parameters

Click OK.

clip_image008

7. Resize and place the report control where you want it on the dashboard.

8. Type a name for the Dashboard and click "Save And Close" button.

Web Resource content

Now let's understand the content of the Web Resource.

The Web Resource is of type html and also contains JavaScript. It first reads the report id from the query string parameters and server url using ClientGlobalContext.js.aspx. Then, it creates an Iframe with src set to viewer.aspx and with proper parameters. Additionally, it removes some UI elements from Iframe to give a cleaner look.

clip_image010

Function SetReport creates Iframe. It first gets the report id from query string parameters and server url. Once, having all the info to create src of Iframe, it creates the iframe element and appends it to document.

clip_image012

In function ShowFrame, two controls menubar and editFilter are set to display:none, since they are actually not required when displaying report on Dashboard or form. This gives more cleaner User Interface.

clip_image014

Function qs(search_for) reads query string parameters and returns report id.

Function getServerUrl returns the server and org url.

You can try creating similar type of Web Resource to display the report/data from other(outside of CRM) sources also.

Happy Dashboarding!

Atul Goyal

The future of Microsoft Dynamics CRM Accelerators

$
0
0

image Coinciding with the release of Microsoft Dynamics CRM 2011 we wanted to give you an update on the accelerators program which was launched in May 2008 for Microsoft Dynamics CRM 4.0 customers and partners. The exciting news is that accelerators are graduating to Solutions in Microsoft Dynamics CRM 2011! We will publish these solutions on the recently launched Microsoft Dynamics Marketplace. The existing CRM 4 accelerator CodePlex sites will be decommissioned the over the next few months.

Which accelerators are graduating?

Of the existing CRM 4 accelerators, we have started by graduating the following to CRM 2011 as solutions:

· Customer Portal

This is the migration of the Customer Portal Accelerator which included Portal Integration, eService and Event Management functionality.

· Partner Relationship Management (PRM) Portal

This is the migration of the Partner Relationship Management accelerator.

· Customer Care Accelerator (CCA)

This is the CRM 2011 version of the Customer Care Accelerator

Additionally, the Non-Profit Solution for Microsoft Dynamics CRM has been migrated to Microsoft Dynamics CRM 2011 and is available on the Marketplace.

Where can you find them?

Solutions have been developed and published to the Microsoft Dynamics Marketplace by Microsoft Dynamics Labs. Keep checking this blog for further release announcements!

In addition to the migrated accelerators, Microsoft Dynamics Labs will publish new solutions to demonstrate additional capabilities of Microsoft Dynamics CRM 2011 or provide a starting point for some innovative CRM extensions. We hope you will find these valuable additions for your Microsoft Dynamics CRM implementation!

What about the remaining accelerators?

The capabilities of these four accelerators are provided as out-of-box features in Microsoft Dynamics CRM 2011:

· Extended Sales Forecasting is provided by the new Goal Management module

· Business Productivity Workflow Tools have been absorbed into the standard workflow and dialogs features

· Business Data Auditing is replaced with a full-featured business data auditing feature

· Analytics R2 is replaced with the investments in contextual visualizations and real-time dashboards

The following four are being considered as potential features or solutions in the future roadmap of the product beyond Microsoft Dynamics CRM 2011:

· Business Productivity Newsfeed

· Notifications

· Social Networking Accelerator

· Enterprise Search R1

Keep checking this blog and Microsoft Dynamics Labs for the updates and latest solutions from the CRM team!

Cheers,

Palak Kadakia

Using OData Retrieve in Microsoft Dynamics CRM 2011

$
0
0

With the release of Microsoft Dynamics CRM 2011, we have added a new Windows Communication Foundation (WCF) data services (ODATA) endpoint. The endpoint facilitates CRUD operation on entities via scripts using Atom or Json format. In this blog I would be talking about some of the considerations when using the endpoint, specifically around the use of retrieves.

First, the operations supported over this endpoint are limited to create, retrieve, update and delete. The REST philosophy does not support other operations and so we followed J. We did not implement others since the story around service operations is not fully developed in the current WCF data services offering.

The $format and $inlinecount operators are not supported. We only support the $filter, $select, $top, $skip, $orderby

Some of the restrictions when using the implemented operators are.

Operator

Restrictions

$expand

· Max expansion 6

$top

· Page size is fixed to max 50 records

· $top gives the total records returned across multiple pages

$skip

· When using with distinct queries, we are limited to the total (skip + top) record size = 5000.

· In CRM the distinct queries does not use paging cookie are and so we are limited by the CRM platform limitation to the 5000 record.

$select

· One level of navigation property selection is allowed I.e.

…/AccountSet?$select=Name,PrimaryContactId,account_primary_contact

…/AccountSet?$select=Name,PrimaryContactId,account_primary_

contact/LastName&$expand=account_primary_contact

$filter

· Conditions on only one group of attributes are allowed. By a group of attribute I am referring to a set of conditions joined by And/Or clause.

· The attribute group may be on the root entity

.../TaskSet?$expand=Contact_Tasks&$filter=Subject eq 'test' and Subject ne null

· (or) on the expanded entity.

.../TaskSet?$expand=Contact_Tasks&$filter=Contact_Tasks/FirstName eq '123‘

· Arithmetic, datetime and math operators are not supported

· Under string function we support Substringof, endswith, startswith

$orderby

· Order are only allowed on the root entity.

Navigation

· Only one level of navigation is allowed in any direction of a relationship. The relationship could be 1:N, N:1, N:N

Cheers,

Shashi Ranjan

Microsoft Dynamics CRM 2011 Resource Center

$
0
0

Check out the updated Resource Center for Microsoft Dynamics CRM 2011! You can access it from within the product or by clicking Resource Center in the left nav pane. Or, if you aren’t logged in, you can view all the same pages at these URLs:

For CRM Online: http://rc.crm.dynamics.com/RC/2011/en-us/online/default.aspx

For CRM 2011: http://rc.crm.dynamics.com/RC/2011/en-us/on-prem/default.aspx

The first thing to notice is that the Resource Center now has the same look and feel as the product. In addition, we’ve made which launch pages you see dependent on your security role in CRM. This is based on feedback from a number of customers and partners.

  • The Highlights launch page shows only articles for Sales, Marketing, and Service users. This page is available for all users without any security restriction in the product.
  • The Administration launch page shows only articles for  IT Pros, Implementers, and Customizers. This page is restricted to only a designated administrator role who has specified privileges which are pre-defined in the out-of-box sitemap. To understand more about such administrator privileges, refer to this SDK topic.

That filtering carries through to the article search as well, so end users won’t find articles intended for administrators.

clip_image002

In order to provide you with fresher content faster, we’ve automated the Most Popular and Recently Added tabs. This means the articles with the most page views and the articles that are newest will be updated more frequently than they were in the past.

clip_image004

If you have any ideas for articles you’d like to see, or comments about the Resource Center, please let me know.

Thanks,

Renee Wesberry



Excel 2010 and Data Import Templates

$
0
0

image Data Import Templates and Update via Import are powerful features of Microsoft Dynamics CRM 2011. Data Import Templates gives you a blank template for an entity in XMLSS format. In the XMLSS Sheet you can enter data and use that for data Import.

Update via Import is another powerful feature which enables you to bulk update CRM records. You can export the data for an entity in XMLSS format. Then do updates to existing records or add new records to the file and use that in Import flow in just 2-3 clicks. The existing records are updated with the new data values and new records are created.

If you are using Microsoft Excel 2010 and you downloaded the file from Microsoft Dynamics CRM Online, depending on the security settings in Excel you may not be able to open the file in Excel 2010 and Excel might throw an error “File is corrupt”. This blogs talks about ways you can use at different levels to open the file in Excel and get rid of the error. You can use any of the method described below.

The issue happens because the file is downloaded from Internet and Excel services tag the file as unsafe because the file is being downloaded from internet (depended on setting in Excel).Excel tries to open the file in protected mode and fails to do so for XMLSS files. Different ways that you can employ to get out of this issue are described below.

File Level Setting

Right click the file and unblock the file. As you observe in below screenshot the security label indicates that it originated outside of this computer, the file may be blocked to protect your computer.

  • Click on Unblock button.
  • Click ok and you are done.

Now you should be able to open the file in Excel. This is a file based setting and if you download any other file, you need to set it again for that file.

clip_image002

Trusting all files originating from CRM Site (Recommended)

Add the CRM Organization URL to trusted sites as shown in the screenshot. If you are subscribed to multiple CRM organizations also add the sign-in page of CRM to trusted sites.

Now any files downloaded from this Organization will be trusted and marked as safe and you would not see that tag in the files downloaded now.

clip_image004

Setting for all files Originating from Internet

Change the setting in Excel to allow it to open the files in normal mode for all files originated from Internet.

a) Go to File->options.

clip_image005

b) Go to Trust center ->Trust Center Settings.

clip_image007

c) Go to Protected view.

clip_image009

d) Uncheck the Settings “Enable Protected view for Files Originating from internet”.

clip_image011

Click ok and then open the file.

Note: Changing this setting enables any files originating from Internet to be opened in normal mode. So use it judiciously.

Thanks,

Dinesh Kumar Garg



CRM MVPs talk about the MVP Program

$
0
0

As part of the Microsoft MVP Global Summit this year we took the time to sit down with some Microsoft Dynamics CRM MVPs and create this video. We seek to recognize the best and brightest from technology communities around the world with the Microsoft Most Valuable Professional (MVP) Award.

These exceptional community leaders come from a wide range of backgrounds. They are teachers, artists, doctors, engineers, as well as technologists, who actively share their high-quality, real-world technical expertise with the community and with Microsoft. With the MVP Award, we thank these inspiring individuals for representing the voice of thousands in the community through the powerful and independent feedback they give us, and for helping our customers maximize the potential of their software.

Cheers,

JaAG



Announcing the Customer and Partner Relationship Management Portals!

$
0
0

image

I am excited to announce the release of the Customer Portal and Partner Relationship Management (PRM) Portal solutions for Microsoft Dynamics CRM 2011!

They can be downloaded from the Microsoft Dynamics Marketplace at:

These solutions are the graduated replacements of the portal Accelerators for Microsoft Dynamics CRM which were previously available on CodePlex. Both of these portals will run on Windows Azure or on your own web servers and they will work against Microsoft Dynamics CRM 2011 both Online and on-premises.

We engaged with Adxstudio Inc. on this project to update the portals to run on Microsoft Dynamics CRM 2011. These solutions use the new solutions framework in Microsoft Dynamics CRM 2011 so they are easier to deploy and manage. We also added some new features, leveraged new functionality in Microsoft Dynamics CRM 2011 to improve some portal experiences and fixed several bugs.

So what can you do with these solutions?

eService

First and foremost, you can provide self-service capabilities to your customers and partners via these web portals. Both portals are fully integrated into Microsoft Dynamics CRM 2011 and allow web users to view and edit personal information, open service cases, search the KB for a solution, and schedule services in a timeframe that meets their needs.

Product Registration

You can expose product registration functionality to the portal so that your customers can register their specific product purchase information. This information is connected to their contact information in CRM and can be used for many sales, marketing and service scenarios.

Event Management

The event management module allows you to seamlessly plan, manage and optimize events with Microsoft Dynamics CRM 2011. Events can be published to the portal where customers can register their attendance for these events. You can then track all responses and leads from those events to maximize business opportunities.

Your customers or partners can view the events calendar, register for one or more events and add the registration information to their calendar.

Partner Relationship Management

The Partner Relationship Management (PRM) portal allows partners to easily engage with your organization on co-selling opportunities.

You can better track, manage and leverage partners by distributing sales leads and centrally managing sales opportunities through the partner portal. Partners can register deals they are working on and download sales literature that you publish to the portal directly from Microsoft Dynamics CRM 2011. You also have the ability to create an “opportunity pool” for sales opportunities with no attached partner. These opportunities are published to the Partner Portal and partners can then “bid” for the right to manage a specific opportunity. The PRM solution allows you to track revenue generated by partners directly in Microsoft Dynamics CRM 2011 which allows for better measurement of partner performance.

Partners are able to easily collaborate and co-sell with you via the portal in a convenient and secure way.

Manage web content from the portal itself

You can customize the functionality, pages, links, formatting, images and all text that goes on the web portal via the portal itself without having any knowledge of web programming.

These portals are community supported so if you have any questions or comments then post them on the CRM Labs Solutions forum. There is a vibrant community of customers and partners who are already using these solutions and should be able to help.

Enjoy!

Palak Kadakia




Metadata Browser for Microsoft Dynamics CRM 2011

$
0
0

People have been asking “Where is the metadata browser in Microsoft Dynamics CRM 2011?”. For those of you who don’t know what the original metadata browser was, see Metadata Browser. The original metadata browser was removed from CRM 2011.

I’m happy to announce that the latest update to the Microsoft Dynamics 2011 Software Development Kit (SDK) includes a managed solution that replaces and I hope improves upon the original metadata browser. To get the new metadata browser you must:

1. Download the SDK (here).

2. Install the SDK.

3. Import the MetadataBrowser_1_0_0_1_managed.zip located in the SDK at SDK\Tools\MetadataBrowser\.

After you install the Entity Metadata Browser it will appear in the Customizations area.

clip_image002

The initial view is just a list of entities with a detail list of the properties for the selected entity. There are capabilities to filter the list of entities. You can choose to filter on the following properties:

  • Custom entity
  • Customizable entity
  • Intersect entity (an entity used in Many-To-Many relationships)
  • Type of entity ownership

You can also do a text search that looks for matches in the following:

  • SchemaName (and by extension Logical Name)
  • Display Name (if the entity has one)
  • Object Type Code
  • MetadataId

For the Properties grid, you can filter the list of property names. This properties grid shows only the simple values for the properties. In reality, many of these properties are objects with many more additional properties. For the sake of simplicity only the most useful property value is shown here.

To view all the details for an entity, you need to right-click the SchemaName value and choose View Details from a context menu. For those entities that appear in the default solution, you also have the ability to select Edit which will open the entity definition in the default solution.

When you view the details for an entity, a new window opens and you can navigate to each of the more complex properties.

The Properties view allows you to drill down and see all the details for the complex properties.

clip_image004

If you expand a Label property like DisplayName, you can see all the details that a Label property has:

clip_image006

The Attributes view shows all the attributes and you can filter by:

  • Custom attributes
  • Customizable attributes
  • Type of Attribute
  • Type of entity ownership
  • Text match on SchemaName, DisplayName and MetadataId

Properties for the selected attribute appear on detail grid.

clip_image008

For OptionSet (Picklist) attributes you can view all the options and expand down to view all the properties for the option set.

Simple view of the Account.AccountCategoryCode.OptionSet property:

clip_image010

Expanded view of all the details:

clip_image012

Similar details are available for entity relationships and privileges.

Most property names and simple values can be copied to your clipboard by right-clicking and choosing the Copy option from a context menu. At this point, complex property values do not support being copied to the clipboard.

Technical Details

Although it is included in the SDK, it isn’t a sample. We aren’t publishing the source code since the vast majority of it is just rendering the UI and that really has nothing to do with Microsoft CRM. The Metadata browser is done using HTML and JScript Web resources. It doesn’t use JQuery or any other supporting libraries.

The SDK.Metadata.js sample library from the SDK is used to retrieve data. A much simpler sample and the full code for that library is published in the SDK at Sample: Retrieve Entity Metadata using JScript.

I hope that this solution will help you explore, understand and make productive use of the Microsoft CRM 2011 entity metadata.

Cheers,

Jim Daly



Update Rollup 16 for Microsoft Dynamics CRM 4.0

$
0
0

The Microsoft Dynamics CRM Sustained Engineering (SE) team released Microsoft Dynamics CRM 4.0 Update Rollup 16 on Thursday, March 10, 2011.

The links below will take you to the necessary information about Update Rollup 16.

General details about Update Rollup 16

Update Rollup 16 is cumulative. However, the Update Rollup 16 CRM Client and Data Migration Client packages require Update Rollup 7 to be installed. For all other CRM components, you do not need to install any previous Update Rollups prior to Update Rollup 16.

The Update Rollup 16 download contains updates for the 40 supported Language Packs. Prior to installing the Update Rollup 16 Language Pack, you must install the original Language Pack.

  • If you have Language Packs installed, you should
    1. Download the Update Rollup 16 Language Pack
    2. Install the Update Rollup 16 Language Pack
    3. De-provision the Language Pack
    4. Re-provision the Language Pack

Information about how to avoid reboots when installing the CRM Outlook Client can be found in the Update Rollup 4 blog posting.

The Update Rollup 16 Client can be deployed before the server is upgraded to Update Rollup 16.

Steps to make the Update Rollup 16 Client available via AutoUpdate can be found in the Update Rollup 4 blog posting. The Link and Patch IDs can be found in KB article 2477743.

Each update rollup could have fixes that require manual configuration. Please see the “Hotfixes and updates that you have to enable or configure manually” section in KB article 2477743.

How to get support for Update Rollup 16

For support, please contact Microsoft Product Support. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: http://support.microsoft.com/default.aspx?scid=fh;[LN];CNTACTMS.

Note: In special cases, charges ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Cheers,

Matt Brown



Microsoft Knowledge Base Articles Authoring and Lifecycle on SharePoint

$
0
0

While Microsoft Dynamics CRM 2011 itself supports Microsoft Knowledge Base (KB) articles, there are much richer systems that support an end to end Content Management Life Cycle that includes Create/Edit/Review/Approval/Publish roles and responsibilities. In this post, we will illustrate how you could use such a system for KB content management while still making articles available in CRM 2011.

For the purposes of this post, we will use Microsoft SharePoint 2010 On-Premise as the Content Management System. We will focus on the integration points between the two systems rather than the content creation process. The configuration matrix for this solution will work is as follows:
 
 

CRM 2011 On-Premises

CRM 2011 Online

SharePoint 2010 On-Premise

Yes

Yes

The way this works is in two parts (i) Create your content in SharePoint (ii) Push the KB from SharePoint into CRM. Now, let’s look at each of these steps.

Content Creation in your SharePoint OnPremise

There are many ways of creating KB Articles on SharePoint since Rich Text Editing is available at many places (for example creation of site pages, wiki pages, blogs, etc.) For this solution, we want our articles created in SharePoint in a way that we can extract them with HTML styles intact so that they can directly be synced to CRM. A more complicated approach could extract style sheets, insert styles at the required places in the html and then push the content to CRM. For this blog, however, we have considered an approach that will directly embed the styles inside the html, keeping the solution simple by not requiring us to write any custom code.

How can we achieve this?

1. Create a custom list on SharePoint as shown below. To create a custom list, you will need to have Manage Lists Permissions.

clip_image002

2. Click on Create Column as shown below:

clip_image004

3. Create a column which will store the title of the KB Article.

clip_image006

4. Create a column which will store the KB Article content. Now, we want to have rich text editing enabled, so choose the type as Multiple Lines of text and in additional settings choose either Rich Text or Enhanced rich text as shown below:

clip_image008

5. This is one of many ways to create KB articles in SharePoint - you can have your own lifecycle/workflow for content creation as you get these KB articles ready for Publishing. Now, lets make an assumption that these KB articles are ready to publish to CRM.

Pushing KB Articles to CRM from SharePoint custom lists:

Now that the articles are ready, let’s look at how we can push them over to CRM. There are 2 parts we need to consider:

1. Reading a KB Article from a SharePoint custom list.

2. Creating an entry for it in CRM/Updating an existing KB entry

Reading a KB Article from a SharePoint custom list:

SharePoint provides various ways of reading a list and list items like the SharePoint Object Model, SharePoint Client Side Object Model (CSOM) and web services (List Web service).

I have used the List web service (Lists.asmx) in this example to read our custom list of KB Articles. The code is as follows:

            ListWebReference.Lists ListService = new ListWebReference.Lists();
            ListService.Credentials = new System.Net.NetworkCredential("username","password","domain");
            ListService.Url = "http://manish_test1:5555/TestBlog1/_vti_bin/Lists.asmx";    // http://<your_site>/_vti_bin/Lists.asmx
            string kbContent = string.Empty;
            string title = string.Empty;
            XmlNode nodes = ListService.GetListItems("My Custom List","",null,null,"",null,"");
            foreach (System.Xml.XmlNode node in nodes)
            { 
                if (node.Name == "rs:data")
                { 
                    for (int i = 0; i < node.ChildNodes.Count; i++) 
                    { 
                        if (node.ChildNodes[i].Name == "z:row") 
                        { 
                            kbContent = node.ChildNodes[i].Attributes["ows_RTEcol"].Value;
                            title = node.ChildNodes[i].Attributes["ows_Title"].Value;
                        }
                    } 
                }
                break;    // for demo purpose, I'm taking just the first List Item.
            }

Now we have read a KB Article from the SharePoint Custom List and its title is present in title string and its contents are present in kbContent string.

The work which is remaining is to create a record for this article in CRM. You can automatically tie the push into CRM with a state change in SharePoint.

Creating a KB Article record in CRM:

We will use Organization service (Organization.svc) for this purpose. Add a service reference for Organization.svc in your project.

 OrganizationServiceClient client = new OrganizationServiceClient();
// For CRM on-prem
            client.ClientCredentials.Windows.ClientCredential.Domain = "domain";
            client.ClientCredentials.Windows.ClientCredential.UserName = "username";
            client.ClientCredentials.Windows.ClientCredential.Password = "password";

// For CRM online
            client.ClientCredentials.UserName.UserName = "username";
            client.ClientCredentials.UserName.Password = "password";


            Entity kbArticle = new Entity();
            kbArticle.Attributes = new OrgServiceReference.AttributeCollection();    // OrgServiceReference is the name given to the organization service reference

            kbArticle.LogicalName = "kbarticle";
                
            //KB Template 
            EntityReference kbArticleTemplate = new EntityReference();
            kbArticleTemplate.LogicalName = "kbarticletemplate";
            kbArticleTemplate.Id = new Guid("C3F93721-91B6-475A-ACD0-0A68AA1CB842");    //Give KB Article template id here, for whichever template you want to create your KB.

            //Subject 
            EntityReference kbArticleSubject = new EntityReference();
            kbArticleSubject.LogicalName = "subject";
            kbArticleSubject.Id = new Guid("56270724-3BA5-4F5C-A84F-A8057B54286E");        //Give Subject Id here
                
            kbArticle.Attributes.Add(new KeyValuePair<string, object>("kbarticletemplateid", kbArticleTemplate));
            kbArticle.Attributes.Add(new KeyValuePair<string,object>("title",title));
            kbArticle.Attributes.Add(new KeyValuePair<string, object>("subjectid", kbArticleSubject));
            kbArticle.Attributes.Add(new KeyValuePair<string, object>("description", "Some Description"));
            kbArticle.Attributes.Add(new KeyValuePair<string, object>("content", kbContent));
            kbArticle.Attributes.Add(new KeyValuePair<string,object>("articlexml",GetArticleXml(kbContent)));
            client.Create(kbArticle);    //Create the KB Article


private string GetArticleXml(string kbContent)
        {
            // Create a new XML document that contains an article data element. 
            XmlDocument document = new XmlDocument();
            XmlElement articleData = document.CreateElement("articledata");
            // Create the first section element that contains the article's content. 
            XmlElement section0 = document.CreateElement("section");
            XmlAttribute attribute = document.CreateAttribute("id");
            attribute.Value = "0";
            section0.Attributes.Append(attribute);
            XmlElement content = document.CreateElement("content");
            /* Depending on your template, you can give KbContent to whichever 
             * section you want to give. For example: you can have description in section 0 and KB Content in section1.
             * In this example, I am putting KB Content in section 0 itself since my template contains just 1 section */
            content.AppendChild(document.CreateCDataSection(kbContent));
            section0.AppendChild(content);
            articleData.AppendChild(section0);
            document.AppendChild(articleData);

            return document.InnerXml.ToString();

        }

Conclusion

This code will create a record for the KB Article in CRM. You can also call SetState to change the KB article’s states like Approved, etc. to directly publish it. Your CRM users will now be able to view the rich KB articles natively. In all likelihood the content lifecycle will be controlled in the external system, so the flow we are illustrating is really one way to push from your Content Mgmt System to CRM 2011. Give this a shot, and let us know what you think.

Cheers,

Manish Arora



Troubleshooting Solution Import for your Upgraded Microsoft Dynamics CRM 2011 Organization

$
0
0

So you have upgraded your Microsoft Dynamics CRM 4.0 organization to Microsoft Dynamics CRM 2011, and you intend to export all upgraded customizations and import them in each of your development/test organizations so that your team can unleash all their creativity by designing new customizations and trying out new extensibility features.

Transporting all your upgraded customizations to another org may not always be successful on the first try. You may encounter various import errors along the way that would require fixes to your upgraded org and a few iterations of export and import. But fret not, as most of these errors are fairly legitimate and are due to the new restrictions imposed by the CRM 2011 solutions framework. They were put in place to help you ship solutions with more reliable customizations. The typical error is similar to this:

"The dependent component [missing Component Type] (Id=[missing Component Id]) does not exist. Failure trying to associate it with [dependent Component Type] (Id=[dependent Component Id]) as a dependency. Missing dependency lookup type = PrimaryKeyLookup"

Our team has tested upgrade and customization transport of hundreds of highly customized databases. In doing such exercise, we discovered that most import failures fall under the same few buckets. I’m going to talk about what causes these common errors and how you can fix them.

Invalid Dependencies

Microsoft Dynamics CRM 2011 Solution Components may depend on each other. These dependencies are tracked so that the system can prevent someone from accidentally deleting a solution component that is required by another solution component. Microsoft Dynamics CRM 4.0 also had dependencies between customizable items, but the infrastructure to track them is much more robust in Microsoft Dynamics CRM 2011.

For example, a custom attribute you create on the Account entity can be added to its FormXml, or as a view column or filter criteria in a SavedQuery. It can be referenced in a workflow, in a plugin assembly, or in e-mail templates. In CRM 4.0, it may be possible to delete this custom attribute even if the components mentioned are referencing it. This is no longer possible in CRM 2011, since the dependency infrastructure prohibits delete of a component until all references of other components to it are removed. So what happens if you upgrade an organization to CRM 2011 in this state?

Firstly, this will not prevent organization upgrade from succeeding. However, once you export your customizations and import them in another CRM 2011 org, it will fail when dependency calculation takes place (Note: Solution Import is now treated as a single transaction, hence one import error will halt the entire process and rollback all the components that have been previously imported). In your import job log, you will get an error with similar to this:

"The dependent component Attribute (Id=new_mycustomfield) does not exist. Failure trying to associate it with Template (Id=58817a33-e52f-e011-8acb-00155db059be) as a dependency. Missing dependency lookup type = PrimaryKeyLookup"

In this case, the attribute new_mycustomfield was deleted in CRM 4.0 though it is still referenced by an e-mail template. With this error, it is already clear which components are problematic. To fix this, the template mentioned should be opened in the e-mail template editor and all references to new_mycustomfield must either be removed or replaced with another attribute depending on the business need for the template.

Here are some common invalid dependency occurrences:

  • Workflows/Processes depending on Attributes that no longer exist
  • Plug-in Steps referencing Attributes that no longer exist
  • FormXml referencing Attributes that no longer exist
  • FormXml referencing a Lookup to a Relationship that no longer exists
  • SavedQueries referencing Attributes that no longer exist (whether in the columns or filter criteria/fetchXml)
  • Templates referencing Attributes that no longer exist

You can fix these invalid dependency errors as they come based on the import log's error message. However, if you have a lot of these in multiple components in your upgraded organization, it will take a lot of time, as you will fix errors only one at a time (solution import halts on the first error and does not process the rest) and you will be doing multiple exports and imports of your customizations.

There is a way of dealing with all invalid dependencies at once. Invalid dependencies are represented by an entity in CRM 2011 (search Microsoft Dynamics CRM SDK for search for InvalidDependency Entity Messages and Methods), and by using the API, particularly the RetrieveMultiple message, on this entity, you will be able to retrieve a collection of invalid dependencies in your upgraded organization. Dump the contents of these records in a text file for reference and make sure to include the values for at least these attributes:

Property

Display Name

Description

existingcomponentid

Existing Object Id

This is the GUID of the component that references a missing component, which in our example is the e-mail template. This is most likely the component you will modify to fix the invalid dependency.

existingcomponenttype

Existing Object's Component Type

This is an integer representing what type of CRM component existingcomponentid is. To map the numeric values to their more recognizable names, search the Microsoft Dynamics CRM SDK for "Global Option Set Values" and see the Component Type section.

missingcomponentid

Regarding

This is the id of the missing component which was deleted when the org was in v4 state.

missingcomponenttype

Type Code

Like existingcomponenttype, this represents what type of CRM component the missing component is.

With the information you can get from retrieving the entire collection of invalid dependencies, you can deal with them right away without even exporting and importing your customizations yet. Applying this practice can save you lots of time.

Missing Dependencies

While invalid dependencies involve broken components because they are referencing non-existing components that were deleted before upgrade to CRM 2011, 'missing' dependencies issues occur when a component is dependent on another component that either was not exported in your solution, or cannot be imported to the target organizations for valid reasons. This can be better illustrated by the following scenarios:

Workflows depending on e-mail templates that are personal or made personal

Personal e-mail templates cannot be a part of a solution nor can it be exported. Hence, if you try to export any solution having a workflow that references a personal template, you will get this warning before you export:

clip_image002

If you decide to proceed with exporting the solution and importing to an organization that does not contain this personal template, it will fail with the Missing Dependency error right before import begins. (Note: Add Required Components button as described in the warning message will not work either, because personal templates cannot be added to any solution)

To get past this error, before you export, you can either

  • Make the template available to the organization
  • Remove the workflow from the solution or delete it.
  • Create a solution containing all other components except the workflow and export that instead.

Reports depending on child reports that are personal or made personal

Similar to the previous example, reports referencing other personal reports will yield the same result. In this case though, it is an option to convert the referencing report to personal as well so both the parent and child reports are personal and won't be exported.

Workflows depending on e-mail templates in a different language that does not exist in target org

E-mail templates can come in different languages, even in previous Dynamics CRM versions. And as we've already implied, workflows can reference them as they can be used to send e-mails. So let's say that, for example, your upgraded organization has an English (1033) base language with Japanese (1041) and German (1031) MUI packs installed and enabled. If you have workflows that use German or Japanese e-mail templates and you export, and then import the customizations into a pure English organization, import will fail while calculating dependencies because the templates in other languages, while they are processed, they are not created because their language does not exist in the target org.

Looking at the import job log, the template will have this warning: "You cannot import this template because its language is not enabled in your Microsoft Dynamics CRM organization."

While the workflow will have the error: "The dependent component Template (Id=abde9d8a-eb2f-e011-8acb-00155db059be) does not exist. Failure trying to associate it with Workflow (Id=2ef0864e-e6d9-4778-a1bb-858fe5e659cd) as a dependency. Missing dependency lookup type = PrimaryKeyLookup."

To get past this error, have all required MUI packs installed in the target organization. Or, if it is an option, package your customizations into different solutions such that the language-agnostic components are separate from the ones that depend on the existence of specific MUI packs.

Invalid Plugin Assembly/Steps Registration

This area is discussed in the Microsoft Dynamics CRM SDK so I will keep this short and quote some specifics along the way (search for "Upgrade Plug-ins and Custom Workflow Activities to Microsoft Dynamics CRM 2011", see "Post Upgrade Issues and Resolution" section).

Back in Microsoft Dynamics CRM 4.0, validations in plug-in registration were very limited. The system allowed incorrect values for plug-in images, entity attributes, and step registration attributes. In CRM 2011, this is no longer the case as full validation is already in place. So, again, what happens when you upgrade an organization to CRM 2011 having plug-ins registered incorrectly?

The short answer is, again, upgrade will not be blocked by such issues. However, exporting then importing them to another org is a different story as this full validation kicks in during import. To resolve import issues due to this, all plug-in registrations must be re-evaluated to make sure that they don't fall under these known configuration issues (taken from SDK):

  1. Specifying an invalid attribute in an image or step. For example, the attribute name is not spelled correctly or the attribute does not exist in Microsoft Dynamics CRM 2011.
  2. Registering a pre-image for a CreateRequest or a post-image for a DeleteRequest.
  3. Specifying an incorrect deployment type. For example, registering a plug-in to execute on an assign of an account for deployment on Microsoft Dynamics CRM for Microsoft Office Outlook with Offline Access when that message and entity combination is supported only on the server.

Understanding these three major buckets will help speed up the process of getting your upgraded customizations to import in other CRM 2011 organizations, as around 90% of the 'first-try' import failures in our customer database upgrade testing fall under these three. Go forth and have fun exploring the new extensibility features in Microsoft Dynamics CRM 2011!

Cheers,

Greg Alicbusan



Microsoft Dynamics CRM 2011 Sitemap Changes

$
0
0

Why doesn’t my new custom entity appear in the navigation pane?

If you are familiar with Microsoft Dynamics CRM 4, then you know that you can easily add a custom entity to any area in the sitemap navigation. When you select an area in the entity metadata editor, Microsoft CRM automatically modifies the sitemap to create an extra group called “Extensions” in the specified area for your custom entity.

In Microsoft Dynamics CRM 2011 changes to the sitemap are not visible until the sitemap is published. This is similar to how forms worked in previous versions. When you create a custom entity and add it to a specific group then you will need to publish the sitemap individually or “publish all customizations.” After publishing you can refresh your browser to see the changes.

Why is this group “unknown” showing up after upgrade?

If you customized the CRM 4 sitemap by adding a custom sub area to the settings area then you will get a group titled “unknownXX” after you upgrade your server to CRM 2011.

clip_image002This occurs because there is no specified title for this group. The reason that you will see this only after you upgrade is because the CRM 2011 settings area is broken down into 4 new groups, whereas in CRM 4 everything was in a single group that unfortunately did not have a title. To fix this you just need to update your settings area similarly to:

<Area Id="Settings" ResourceId="Area_Settings" Icon="/_imgs/settings_24x24.gif" DescriptionResourceId="Settings_Area_Description"> <Group Id="Settings"> <Titles> <Title Title="Your Custom Title" LCID="XXXX" /> </Titles> <!--The rest of your sitemap customizations--> </Group> <!--More groups added by CRM--> </Area>

Going forward if you see “unknown” for one of your other custom areas, groups or subareas you will want to double check that you have specified a title for the element.

See the SDK topic Editing the Site Map for specific information about how to edit the sitemap.

Cheers,

Brandon Simons



Viewing all 592 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>