Saturday, January 2, 2010

Email Verification integration for CRM via free Web Service

Email address plays a very important role in CRM.  Take one for example, synchronization of Contact records and activities between CRM and Outlook is heavily relying on contact email address as the common identifier.  Also,  email address is commonly used as the unique identifier for duplicate detection rules for Contact and Lead records.  More over, my company’s Marketing and Sales teams are doing more and more email marketing these days.  And it is very important that email addresses get verified before email marketing communications are sent. 
For all these reasons above, I have always wanted an email verification functionality in CRM, and I did my research to find cost-effective ways to implement the feature.  However, email verification service providers such as Melissa Data, StrikeIron, CDYNE, TowerData all come with annual cost of thousands of dollars.  And due to the recent economic crisis, my company is putting a freeze on all IT capital budgets.  So I have to find free or cheaper ways to get this done.
Until recently, I stumbled upon a free web service provider called “WebserviceX.NET” .  And luckily, one of the web service it hosts is a email verification service.  I was so excited, and jumped right on it to integrate it into my company’s CRM system.  At  first, following the example in this article, I added a inline toolbar button on the Lead and Contact forms to provide one-click access to verify email address on the fly.  And then added the client side web service call function to do the actual email verification, and update the result back to the Lead or Contact record.  Here are excerpts of the code and a screenshot of it.

// add inline toolbar for email verification
    window.GeneralToolbar = new InlineToolbar("new_inlinetoolbar");
    GeneralToolbar.AddButton("btnVerifyEmail","Verify This Email","15%",ValidateEmail);
    // attach the ValidateEmail function to the OnChange event to the "Email Address" field
    field = document.getElementById("emailaddress1");
    field.attachEvent( "onchange" , ValidateEmail );
function ValidateEmail()
{
// if email address field is changed with new value, call web service to validate it
// and log the new result and timestamp
// var field = event.srcElement;
if( crmForm.all.emailaddress1.DataValue == null ) return;
document.body.style.cursor = 'wait';
var email = crmForm.all.emailaddress1.DataValue;
var validemail = ValidateEmailWebService(email);
crmForm.all.new_emailstatus.ForceSubmit = true;
crmForm.all.new_emailverifiedon.ForceSubmit = true;
crmForm.all.new_emailverifiedon.DataValue = new Date();
if (validemail=="true")
    {
        crmForm.all.new_emailstatus.DataValue = "Good";
    }
else if (validemail=="false")
    {
        crmForm.all.new_emailstatus.DataValue = "Bad";
    }
document.body.style.cursor = 'default';
}
function ValidateEmailWebService(email)
{
var soapBody = "<soap:Body><IsValidEmail xmlns='http://www.webservicex.net'><Email>" + email + "</Email></IsValidEmail></soap:Body>";
soapXml += soapBody;
soapXml += "</soap:Envelope>";
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("POST", serverUrl+ "/ValidateEmail.asmx", false);
xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlhttp.setRequestHeader("SOAPAction", "http://www.webservicex.net/IsValidEmail");
xmlhttp.send(soapXml);
xmlDocUser=new ActiveXObject("Microsoft.XMLDOM");
xmlDocUser.async=false;
xmlDocUser.loadXML(xmlhttp.responseXML.xml);
var result = xmlDocUser.getElementsByTagName("IsValidEmailResult")[0].childNodes[0].nodeValue;
return result;
}

image

Sunday, December 20, 2009

Another Social Media integration for MS CRM – SalesView from InsideView

This was truly an accidentally discovery, but a rather good one.  Yesterday, I stumbled upon the web site of InsideView, and got interested in their application called SalesView, which according to InsideView, “is an on-demand Sales 2.0 intelligence application that discovers sales opportunities across both traditional editorial sources and social media and can present them directly within CRM applications for optimum impact”.  After reading a little more on the site, I learned that their product SalesView is available as a Sales 2.0 mash-up with MS CRM 4.0, and they even have a free version available with limited features.  They even has the endorsement from the General Manager for Microsoft Dynamics CRM.  Immediately, I decided to give it a try.
So I registered at the site to obtain access to the free version of their software.  After my registration, I received an email from InsideView, with detailed instruction on how I can add customization code to the Account and Lead entity form in my CRM application to add the SalesView mash-up on these two forms.  It took me less than ten minutes to apply the changes, and wah-lah, the mash-up is up and running.  Here is how it looks on the Account entity form:
image
image
image
From the free version, I am already seeing the benefits of instant access to company key information, instant access to social networks such as LinkedIn, Facebook, Twitter, etc., and plus other contents from traditional medias and blogs.  With the Pro and Team version, there are much more advanced features to enjoy. 
image

Wednesday, December 16, 2009

Implementing List Web Part for Microsoft Dynamics CRM 4.0 on your SharePoint Intranet

Recently, I started my project of rebuilding my company’s Intranet on the Windows SharePoint Service 3.0 platform.  Since I also manage my company’s MS CRM system, and I know Microsoft has released a List Web Part for CRM 4.0, so it was a natural decision to integrate CRM with SharePoint.  First of all, I started out my work following instructions from these posts on MS CRM Team blog:
The List Web Part installation was very easy, and no error occurred.  Then I went on to configure Kerberos authentication on all the IIS servers, and configured trust for delegation for all involved servers.  And when I was ready to test and added the List Web Part to a test page, I faced the same famous Log In prompt window like a lot of others do. 
image
I went over the following checklist provided by one of commentators on the blog post over and over again, and yet still clueless of what went wrong.
• Create NetBIOS SPN’s for all servers in the farm
• Create FQDN SPN’s for all servers in the farm
• Create CNAME SPN for intranet site (if you have MOSS you're likely to have mysites etc as well)
• Set up trust for delegation (Kerberos, trust any) on each server in the farm
• Set up trust for delegation (Kerberos, trust any) on each service account in the farm (including the SQL service account)
• Switching authentication methods using a script to use both NTLM and Kerberos
• Switching authentication methods in the SP central admin GUI/site using Kerberos (only).
So I left it alone for a few days.  And last week, I went back and revisited the issue.  Then all of a sudden, I realized one difference in my topology set up comparing to the others.  Due to limited hardware resource, I had the SharePoint Central Administration site on the same server as the SharePoint Intranet application, yet on different ports.  The SharePoint Central Administration site used a domain user account on one port number, and the Intranet application used the default Network Service account on another port number, so I should have defined separate SPN for each.  And then I did.  This time, the List Web Part is working fine, but then I got “Access Denied” error when I tried to access the SharePoint Central Administration site from my workstation. 
image
And after searching on Google, I dig up an article that described how IE 6.0 and later versions of IE ignores port number on Kerberos authentication, thus causing a “Duplicate SPN” error.  Once identified the cause of the problem, I followed the steps in this post to apply registry changes on my machine.  Wah-lah !  Everything is now working fine on my machine, both the web part page and the administration site.  I sure learned a lot about Kerberos authentication through this exercise.

Monday, December 14, 2009

Social Connection - LinkedIn to Microsoft Dynamics CRM

Inspired by a post at Microsoft Dynamics Team blog, I started to implement a connection to LinkedIn within my company’s CRM application.  The customization is pretty easy and straight forward as it is only a few line of HTML and Java Script code.  And the result is great, Sales Reps and Teleprospectors in my company love this handy customization very much.  The only different in my customization is that the sample from Microsoft Dynamics Team blog placed the customization on the main entity form as an IFrame, whereas I put it on the left side navigation pane with link to a static html page and customization to the ISV XML file.   Below are the html codes and ISV changes:
//***** source code for static html page  *****
<html>
<head>
<script src="http://www.linkedin.com/companyInsider?script&useBorder=no" type="text/javascript"></script>
</head>
<body>
<center>
<span id="getlinkedin"></span>
</center>
<script type="text/javascript">
var parentForm = parent.frames.document.crmForm;
new LinkedIn.CompanyInsiderBox("getlinkedin",parentForm.all.name.DataValue);
</script>
</body>
// ***** ISV customizations  *****
<NavBarItem Icon="/_imgs/ico_18_4502.gif" Url="/customizations/linkedin/linkedinconnections_account.htm" Id="AccountLinkedInConnections">
  <Titles>
    <Title LCID="1033" Text="LinkedIn Connections" />
  </Titles>
</NavBarItem>

That is it !  Now when I am viewing the Account record of Coca-Cola, I can see that I have 17 connections in LinkedIn from this company with my LinkedIn account.

image

And when I click on the link to see all the connections, then I can see the whole whopping 22,100 connections for this company

image