Monday 10 June 2013

mscrm_facebook integration : Display Contact picture from Facebook in mscrm


http://blogs.msdn.com/b/crm/archive/2011/09/28/displaying-a-contact-s-facebook-picture-in-microsoft-dynamics-crm-2011.aspx

This Entire Integration is based on 0nly one URL and that is,
As you may Know, Each and Every User in Facebook has an Unique ID, Some change them into Alphabets called
“your Facebook URL” you can do this in Facebook Setting, and some leave as Numbers.
This User’s Facebook URL can be Generally fall in Users First and Last name, as follows
So, Most of the Organizations Collect First and Last name while creating a contact.
If you use
http://graph.facebook.com/userid/picture?type=large  //Large size picture
http://graph.facebook.com/userid/picture?type=small // Small size picture
http://graph.facebook.com/userid/picture?type=normal // Normal size Picture
the above url Displays users Profile Picture separately without any other user Information.
Now. we come to CRM,
Create a new CRM webresource javascript type and paste the following code.
function pp()
{
var profilepicture = Xrm.Page.getControl(“WebResource_profile”);
// ”WebResource_profile” Name of the other web resource which you place in the form to display the Picture. 
if (!profilepicture)
{
return;
}
//Get the first and lat name of the Contact
var fn = Xrm.Page.data.entity.attributes.get(“firstname”).getValue();
var ln = Xrm.Page.data.entity.attributes.get(“lastname”).getValue();
var fin = fn+ln; // Concatenate the First and last name without space.
var furl = ”http://graph.facebook.com/” + fn + “/picture?type=large”;
//Then set the finalized URL as the Source for the web-resource placed in the Form.
profilepicture.setSrc(furl);
}
The Above Code downloads the Large picture from contact’s Facebook account.
Now, Customize the Entity Form by adding a new webresource, with some common profile picture as default.
add the JavaScript webresource with any message you want, onload, OnSave or Onchange of the Form method.
you can also further redesign the code by inserting a new field for facebookID and pass the data directly in to URL, in this case the CRM user must know the contacts FacebookID to Display the Picture.
I do know that the resultant picture is not 100% accurate and not reliable.
But I hope this code can be further developed which might enable the CRM users to search the Contacts in facebook and Save the Desired Picture from the result.

Friday 7 June 2013

Twitter interface integration with mscrm 2011

In the sample below I will show you how to integrate Microsoft Dynamics CRM and Twitter on Account form. Below are the detailed steps:

* Save the below html code to an html file (Copy and paste into Notepad and then do a Save As)

<HTML><HEAD>
<META charset=utf-8></HEAD>
<BODY contentEditable=true>
<SCRIPT src="http://widgets.twimg.com/j/2/widget.js"></SCRIPT>

<SCRIPT>
var search = parent.document.forms[0].all.name.DataValue;
new TWTR.Widget({version: 2,type: 'profile',rpp: 10,interval: 2000,width: 630,height: 300,theme: { shell: { background: 'transparent', color: '#333' },tweets: { background: 'transparent', color: '#333', links: '#c10000' }
},
features: { scrollbar: false, loop: true, live: false, hashtags: true, timestamp: true, avatars: true, toptweets: true, behavior: 'default' }
}).render().setUser(search).start();
    </SCRIPT>

</BODY></HTML>

*Go to CRM, Settings, Customizations, Customize The System, Web Resources and Click the New button.
* Give the Web Resource a name and specify the type as a Web Page. Browse to the location where you saved your html file, select it and then press the save button.
* Customize the Account entity by going to Settings, Customizations, Customize the Solution, Entities, Leads, Form and add the Web Resource to the Main Form. Open up the Main Form, click the Insert tab and select the Web Resource that you just created.
* Save and Publish

You will now see a windows on the Account  form for the Twitter  interface. When you Can find top 10 Twits for this account 

Linkedin interface integration with mscrm 2011

In the sample below I will show you how to integrate Microsoft Dynamics CRM and LinkedIn. I found a post from Leon Tribe (an MVP for Microsoft Dynamics CRM) that explains it clearly for Microsoft Dynamics CRM 2011. Below are the detailed steps:

* Save the below html code to an html file (Copy and paste into Notepad and then do a Save As)

<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.companyname.DataValue);
</script>
</body>


*Go to CRM, Settings, Customizations, Customize The System, Web Resources and Click the New button.
* Give the Web Resource a name and specify the type as a Web Page. Browse to the location where you saved your html file, select it and then press the save button.
* Customize the lead entity by going to Settings, Customizations, Customize the Solution, Entities, Leads, Form and add the Web Resource to the Main Form. Open up the Main Form, click the Insert tab and select the Web Resource that you just created.
* Save and Publish

You will now see a windows on the Lead form for the LinkedIn interface. When you change the Lead record’s Company, the LinkedIn window is adjusted to show you who you know that works there and a link to show everyone else that works there that you may have access to.