Wednesday, 30 January 2013

CRM 2011 On Premise Customer Portal - Authentication by Active Directory

Hi all,

Since, last few days, I found out many people struggling with how to configure Customer Portal for CRM On Premise without using Window Live ID. So today, I am going to show you guys how to configure Customer Portal for CRM On Premise and using Active Directory authentication instead of using Window Live ID (which is for CRM Online).

Here is the step by step:

1. Download the Customer Portal for CRM 2011 - using AD from this blog:

That's is the Zip file of Customer Portal CRM 2011 (as you could download from pinpoint also). However, in this version, the blog author changed some codes and configuration values inside, which will help you to use the Active Directory authentication for the portal.

2. After unzip the folder, please navigate to the "Documentation" folder, open the "Customer Portal Deployment Guide_OnPremises_V2.0" file. Start from "Deployment Steps", you now follow the document from step 1 to step 3:
     - Step 1: Follow the document to import the solution into your CRM.

     - Step 2: You could skip this step. No need to do anything with it.

     - Step 3: Going your "SDK" folder (you should download SDK for CRM from Microsoft Source) --> Tools --> WebsiteCopy --> launch the "WebsiteCopy.exe" file. And follow step by step in the document.
      Note: in the end of the copy website process, the wizard will ask you to copy the "connectionString", you please copy it to somewhere.

So in the end of this stage, you have your Customer Portal in CRM as shown in below image !

3. In the "Customer Portal" folder (which you unzip at step 2), navigate to CustomerPortal --> Web --> Web.config file. Open the file, look at the "connectionStrings" part and especially the bold lines:

    <add name="Xrm" connectionString="ServiceUri=http://crm2011/Contoso; Domain=CONTOSO; Username=webportal;
    <add name="ADConnectionString" connectionString="
LDAP://,DC=contoso,DC=com" />  
  <!--<add name="Live" connectionString="Application Id=0000000000000000; Secret=00000000000000000000000000000000"/>-->
    <!--<add name="Bus" connectionString="Service Namespace=???; Service Path=???; Issuer Name=???; Issuer Secret=???; Include Exception Detail In Faults=true"/>-->

Now, you need to change the connectionString (bold lines) into the correct: CRM URL (http://crmserver-name/domain-name), Domain, Username (of administrator, for example) and password. For the next line, do the same thing, change URL, Username, Domain (DC).

**Note: The username here should be the one has been created in AD, so later this AD account will be used to login the portal via AD Authentication.

4. In the same server, open IIS Manager (Internet Information Services):

- Navigating to "Sites" node, click right mouse to create a new website. Give approciate name for the website and put the physical path as the file in Customer Portal folder.

- After creating the website, right click on it in Application Tool tab, change the .NetFramework version to v4.030319.

- Finally, try to browse your website in IIS, now the portal will work and it connected to your CRM, using AD Authentication !

I hope the post is useful for you guys ;)

Sunday, 23 December 2012

Business Intelligence Overview

It is such a long time no posting anything. I feel a bit disappointed of myself when I couldn't spend more time for this blog. As it is a part of my job, I should maintain it more sufficiently thought.

Recently, I joined a long long project which is totally non-related to CRM, it's all about BUSINESS INTELLIGENCE ! Feel being distracted a bit when I kept dragging between CRM and BI...

Anw, I initially was an Information Systems student. My major is working with data, making them from boring numbers becoming interesting things. Today I would like to spend time to provide you guys (who interested in BI) what I have learnt about BI. The agenda for the post is:

1. What is Business Intelligence ?
2. How does BI actually work?

I hope someone out there will interested in this blog.

1. What is Business Intelligence ?

Okay, in general, BI could be defined as the delivery of accurate, useful information to the decision makers. Here I would like to emphasize the "Accurate & useful" information. It means, they are not only just raw numbers, their are "meaningful" and have ability to tell you something.

For example, for sure, from financial perspective, every company has maintained some kind of operation reports which include transaction records, bank records, etc. But finance professionals want to also move beyond standard reporting to analyse details, provide summary to optimise financial performance, such as: Total Sales, Revenue, Profit Margin, etc. To achieve these goals, you must have full insight into the bottom line, cash flow, investments, sales and many other factors. BI is the tool helping you to combine all of those information into one package.

Business Intelligence, to a great extend, is a stack of Data Discovery and Knowledge Management, and is a higher level of Operational Reporting Services. Looking at the diagram below to understand more levels of Data Discovery:

The lowest degree of intelligence is Statistics Information. They normally are raw numbers. People normally use standard reports or operational reports to present them. From there you will see what is the fact ? what is actually happening ? Those kind of information is provided daily, weekly, monthly and always be the same. They are good for people who are in operational level. Whereas, while look into the upper level of Intelligence, where BI located. After analyzing raw statistic, BI provide you the insight of information. It not only shows you what is happening anymore, it but also provide you why it is happening and predict the trends what would be happened in the future.

2. How does BI actually work?

I might make you guys feel boring a bit with the all above theory about BI. The next question will be, how does BI actually work ? How could it help us to understand the meaning behind numbers?

Well, pls take a look at the below diagram:

The concept of BI could be understood simply like this: you collect raw data from different sources. For example, in an organisation, you have different departments with different databases, storing different information from: Sales (bills, orders, invoices..), CRM (Accounts, Contacts, Cases..), Supply Chain (products, inventory movement…), etc. Then putting all of raw data into a “Data warehouse”, generating “Cubes” which contains all of those information. And finally, doing analytic queries and  presenting them by using BI Tools such as in graphs or reports…

 When talking about BI, definitely we need to understand the definitions of "Cube", "Dimension" and "Measure".


In order to provide meaningful information,  BI stores it data in Analysis Database (as shown in the above picture). Different from normal database, organize data in rows and columns, Analysis Database used cubes to present BI data. Cubes used for business intelligence is divided into two units :
Measure: a measure (or fact) is a numeric quantity expressing some aspect of an organisation’s performance.
Dimension: a dimension is a categorisation used to break down an aggregate measure to its constituent parts.
In the picture above, the measure here is Total Sales & the dimentions are Year & Product Type.

Wednesday, 20 June 2012

Promote to Campaign Response button is disabled in CRM Outlook - Tips & Tricks

Hi everyone,

I just wanna quick update a trick to overcome the problem when your "Promote to Campaign Response" button in CRM outlook is disabled.

The scenario here is: you send out an email to a customer via CRM Outlook. Then the customer replies and you want to convert the replied email to a campaign response (even originally the out-going email is not a part of any campaign).

Here is what will happen:

You can click "Track in CRM" button to track the replied email as below:

But when you click "View in CRM", on the email form, the "Promote to Response" is disabled
as below:

The reason for this is:  the email activity needs to be a campaign activity (belongs to a campaign).

So solve the problem, very simple. You go back and "Set Regarding" the replied email to any campaign activity you have in CRM as below:

So now the button is enabled for you to convert into campagin response ! Bingo !

Note: Sometimes, there will be another reasons that could make the "Promote to Response" button disabled also. For example, the person who want to promote an activity to a response need to be the person owns that activity at the first time. Or your CRM Settings lacks of some required features. To ensure everything is correct, you could read this article to learn 4 ways to use "Campaign Response" in CRM : 

If you have any problem with it, please email me at Im willing to discuss ;)


Friday, 15 June 2012

CRM 2011 Online Authentication for Custom Web application

Hi everyone,

Long time no post.

Today I would like to show you guys how to authentication CRM 2011 Online in coding .Net C#.
The objective is: creating a custom web application capturing contact information, then updating the information into CRM Online.

For CRM On Premise, to do so, you guys could follow exactly the same to this blog:

However, in order to connect to CRM 2011 Online using IOrganizationService Web Service, you need to change the code a bit to make the authentication through (Remember, CRM On Premise using AD authentication, but CRM Online using Windows Live ID to do that).

So please, following the above blog until the code inside and using the below code for CRM Online Authentication:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.ServiceModel.Description;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Crm;
using Microsoft.Crm.Tools;
using System.Net;
using Microsoft.Xrm.Sdk;
using Microsoft.Crm.Services.Utility;
namespace CRM_Test2
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)

        private static ClientCredentials GetDeviceCredentials()
            return Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice();

        protected void Button1_Click(object sender, EventArgs e)
            //Authenticate using credentials of the logged in user;
            string UserName = "";   //your Windows Live ID
            string Password = "crmadmin@123";    // your password
            ClientCredentials Credentials = new ClientCredentials();
            Credentials.UserName.UserName = UserName;
            Credentials.UserName.Password = Password;
            Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
            //This URL needs to be updated to match the servername and Organization for the environment.
            Uri OrganizationUri = new Uri("https://<CRM-Online-Server-Name>/XRMServices/2011/Organization.svc");           //this URL could copy from Setting --> Developer Source
           Uri HomeRealmUri = null;
            //OrganizationServiceProxy serviceProxy;  
            using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, GetDeviceCredentials()))
                IOrganizationService service = (IOrganizationService)serviceProxy;
            //Instantiate the contact object and populate the attributes.                     
            Contact contact = new Contact();
            contact.FirstName = txtFirstName.Text.ToString();
            contact.LastName = txtLastName.Text.ToString();
            contact.EMailAddress1 = txtEmailAddress.Text.ToString();
            Guid newContactId = service.Create(contact);           
            //This code will clear the textboxes after the contact is created.
            txtFirstName.Text = "";
            txtLastName.Text = "";
            txtEmailAddress.Text = "";
            txtPhoneNumber.Text = "";


Notice the red lines in above code. That's the difference between authenticate in CRM Online and On Premise. For Online version, you need to call the function named "GetDeviceCredentials()", which is defined as private function before that. In order to use this function, you MUST to add one more item which is from SDK --> SampleCode --> Cs --> deviceidmanager.cs. So add this new item into your solution.

After adding the deviceidmanager.cs item, open the cs file and add one more nesscessary reference for using the item, which is: System.Security.Cryptography.

Then now build the whole solution ! Everything is done !

Any question or unclear point. Please drop me an email at I will reply you very quick ;)

Have a nice weekend ;)

Friday, 4 May 2012

Unable to configure CRM 4.0 Outlook Client after installing CRM 2011 Outlook Client

Hi everyone,

Today, I spent the whole afternoon to figure out what was wrong with my CRM Outlook Client !!! My situation is I installed CRM 2011 Outlook Client already. However, for testing CRM 4.0 purpose, I need to install CRM 4.0 Outlook Client also. What I have done is:
- Download CRM 4.0 Outlook Client Setup
- Install it
- Open Configuration Winzard in Microsoft CRM 4.0 Outlook Client
- Run the Configuration Winzard (by putting my CRM 4.0 URL into it)
---> I met this error "Action Microsoft.Crm.Config.Client.InstallPstAction failed. LaunchOutlookInstallerProcess failed" and the installation was fail.
I guessed there is a conflict between CRM 2011 and CRM 4.0 Outlook Client. So I uninstall CRM 2011 Outlook Client and try to run the CRM 4.0 Configuration Winzard again. But the problem is not solved !!!!!  In the end, I figured the solution for that. After uninstall CRM 2011 Outlook Client, there is still one file which is not uninstalled and you need to delete it manually. So the steps are:

1. Navigate to C:\Program Files\Microsoft Dynamics CRM\Client\ConfigWizard directory or C:\Program Files (x86)\Microsoft Dynamics CRM\Client\ConfigWizard directory.
2. Delete the CRMForOutlookInstaller.exe file.
3. Do one of the following options:
          - Replace the CRMForOutlookInstaller.exe from the 4.0 client install bits.
          - Run a repair on the Dynamics CRM 4.0 Client for Microsoft Office Outlook installation.
          - Uninstall and reinstall the CRM 4.0 Client.
4. Run the Configuration Wizard.

So now the installation is good already ! I hope it helps. Thankssss ! :D


Tuesday, 13 March 2012

Microsoft Business Intelligence - Distinguish between SSAS, SSRS & SSIS

I originally decided to develop my career path in Business Intelligence. To be honest, I am not a great coder. But I am very interested in everything related to databases, information systems and analyzing. Therefore, though BI is absolutely a ideal place for me to start.

Last week, my boss asked me to distinguish SSRS, SSAS and SSIS which somehow are called similarly with each other and are all BI services developed by Microsoft. I searched on the Internet, and figured out that there are also a lot of people having the same question. So spending one day to get my answer.

Before understanding what are SSRS, SSAS and SSIS, you might need to know Business Intelligence Development Studio (BIDS) and SQL Server Management Studio (SSMS) which both are tools from Microsoft for managing database, doing tasks related to data processing. Whereas:

-  BIDS is a place that you could develop and deploy BI projects. BIDS run in Visual Studio environment. Therefore, when you open BIDS, you will see the interface is exactly the same with when you develop a new VS project. However, you do not need install VS in order to use BIDS. You could install and run BIDS seperately with VS also.

- SSMS is a database management system, which is the "head office" of Microsoft SQL Server.

1. SSAS: SQL Server Analysis Service

    - Is a part of Microsoft SQL Server, which is a database management system.

    - In SSAS, the database is organized in cubes (dimensions and measures).

    - Developers use BIDS to develop and deploy Analysis Services projects. After that they could use SSMS to manage the Analysis Services databases instantiated from these projects.

Using BIDS to create a new Analysis Service project

      The screen how to develop a Analysis Service project in BIDS


After deploy a Analysis Service project in BIDS, you could use SSMS to open and manage the Analysis Service database

2. SSRS: SQL Server Reporting Services

- Is as server-based report generation software system. It can be used to prepare and deliver a variety of interactive and printed reports.

- SSRS uses Microsoft SQL Server databases or Microsoft SQL Server Analysis Services databases as a data source for reports.

- Using BIDS to develop and deploy reports.

Using BIDS to create a new Report Server Project

3. SSIS: SQL Server Integration Services

- Is a tool that is used to perform ETL operations (extract, transfrom and load data). It means it mainly is used to transform data from a database to another database.

- SSIS packages is created, deployed and executed in BIDS. However, you could execute the SSIS packages in SSMS as well.

Using BIDS to create a new Integration Service Package

Developing an Integration Service package in BIDS

After creating an Integration Service package in BIDS, you could use SSMS to execute the package

So I hope this blog could help you guys to understand to whole BI tools provided by Microsoft. Thank you for reading !!!


Wednesday, 22 February 2012

Creating a custom report in CRM 2011 by BIDS


Long time no post on my blog. Actually, sometimes I wonder whether I should continue this blog anymore or not... No one really care to this one... :D

Anws, still on my way study everything about CRM: javascript, plug-in, silverlight, BI, reporting... A lot of things.. And till now I'm quite happy with what I studied. At least I began knowing what can do with CRM, and how to do that,etc. which are good when you meet the customers :D.

Today, regarding a demand from people on Microsoft CRM forum for knowing how to create a custom report in CRM. Then I decided to wirte this blog to describe step by step how to achieve this purpose.

Firstly, you need to have the following things in order to create and deployed a report successfully in CRM:
- Business Intelligence Development Studio (BIDS) which run on Visual Studio platform.
- Ensure that your CRM includes Microsoft Dynamics CRM Reporting Extensions.
- Your CRM reporting server URL (which you define when setting up CRM system)

Here is step by step:

- Step 1: Open your BIDS. Remember that BIDS run in VS environment, then you will see the VS screen openned up.

- Step 2: Creating a new Reporting project

- Step 3: In Solution Explorer --> Right Click Report --> Create new report --> you will see the Report Wizrad pop up

- Step 4: Creating a Data Source for your report. Data Source is like a link which connects your report to the database storing your data. In order to define a Data Source, you need to know your Database Server and Database Name:

-Step 5: After defining the Data Source, clicking Next --> Query Builder window will pop up. Here is the place that you build queries to retrieve your data.

-Step 6: Click Query Builder --> Click Add Table icon --> Choose all tables that you need (in this example, I chose Account Table )

- Step 7: After adding tables, selecting fields that you want to view in the report. You will see the equivalent query to your select below.

- Step 8: Click Next until the end of the dialog and put name of report inside. Now you have a report interface like that:

The left hand-side is all things included in your report. You could see "Name","Address".. fields in the report content.

- Step 9: Now, if you want to add some more parameters to filter your report result. You could go to "Parameter"  --> Add New

- Put available values for the parameter. Here I would like to put the "Account Name" field

- Step 10:  Now the report is nearly done. Then you "Build" the report.
                 After that, need to Deploy the report into your CRM Reporting Server. To do so, open Properties, add "TargetReportServer" by your Reporting Server URL:

- Step 11: Go to your CRM --> Workplace --> Report --> Add new report --> Add existing report --> put the "RDL" file in your report project into the CRM

- Step 12: Testing your report by opening it ! Here you will see the filter condition which is "Account Name" we created before and the result when running report.

Please feel free leave your comment if you dont understand any step. :D. And Please comment a bit if you find this blog is useful :P. Many thanksssss