Click here to Skip to main content
15,891,248 members
Articles / Web Development / IIS
Article

Microsoft Office Sharepoint Server 2007(MOSS 2007) And Microsoft CRM Integration

Rate me:
Please Sign up or sign in to vote.
3.42/5 (34 votes)
17 Mar 2008CPOL 73.5K   942   47   6
The purpose of the integration is to create collaboration sites on SharePoint 2007 as new accounts or opportunities are created in Microsoft CRM.

Introduction

The purpose of the integration is to create collaboration sites on SharePoint 2007 as new accounts or opportunities are created in Microsoft CRM.

Whenever a new account or opportunity in Microsoft CRM is created, a workflow will be triggered. The workflow will execute a .NET assembly called "{SomeName}.dll". This assembly is responsible to create the corresponding collaboration site on SharePoint server.

Using the code

Workflow Architecture  See figure Workflow rule.jpg



Code to Apply Logo to Sharepoint Site

private static void ApplyLogoToSharepointSite( string siteName , string entityName)
 { 
 SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
  string siteURL = ConfigurationReader.GetSharepointSiteUrl(); 
 SPVirtualServer dashboaordServer =       globalAdmin.OpenVirtualServer(new Uri(siteURL));
Microsoft.SharePoint.SPWeb _web =   dashboaordServer.Sites["sites/"+siteName].RootWeb;
  Logger.Instance.LogComment( _web.Url );
if (_web != null)
 {
_web.AllowUnsafeUpdates = true;
_web.SiteLogoUrl =  ConfigurationReader.GetSharepointSiteLogoUrl(entityName);
 _web.Update();

 }

Points of Interest

Creating Workflow rule in CRM

1.Open Work flow manager.

WorkFlowRule1.jpg(see in document)

<shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><stroke joinstyle="miter"><formulas /><f eqn="if lineDrawn pixelLineWidth 0"><f eqn="sum @0 1 0"><f eqn="sum 0 0 @1"><f eqn="prod @2 1 2"><f eqn="prod @3 21600 pixelWidth"><f eqn="prod @3 21600 pixelHeight"><f eqn="sum @0 0 1"><f eqn="prod @6 1 2"><f eqn="prod @7 21600 pixelWidth"><f eqn="sum @8 21600 0"><f eqn="prod @7 21600 pixelHeight"><f eqn="sum @10 21600 0"></formulas /><path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><lock aspectratio="t" v:ext="edit"><shape id="_x0000_i1025" style="WIDTH: 6in; HEIGHT: 4in" type="#_x0000_t75"><imagedata src="file:///C:\DOCUME~1\AVINIS~1.AWA\LOCALS~1\Temp\msohtml1\02\clip_image001.png">

WorkFlowRule2.jpg(see in document)

WorkFlowRule3.jpg(see in document)

Here we specify the parameter value which will be passed from workflow rule to .net assembly code. We need to pass the accountid and opportunityid respectively for Accounts and Opportunities.

WorkFlowRule4.jpgDownload Proteans.zip - 2,475.7 KB

Then after successfully creation of workflow rule, we need to activate the workflow rule.

History

Update will be coming very soon.............

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralSharepoint and MS CRM 3.0 not on same machine Pin
inge-andre1-Sep-08 3:26
inge-andre1-Sep-08 3:26 
QuestionHow to open sharepoint site when probablity reaches 65 automatically Pin
Sonia1623-Jun-08 5:32
Sonia1623-Jun-08 5:32 
Questiona question on the code to create sites Pin
jolee234-Mar-08 16:47
jolee234-Mar-08 16:47 
AnswerRe: a question on the code to create sites Pin
Avinish Awasthi17-Mar-08 3:25
Avinish Awasthi17-Mar-08 3:25 
If you are familiar with CRM customization then you need to add custom feilds in Account.Then publish it.Basically Its a custom DLL.Which needs to be put on in the bin directory of CRM workflow.So After that you need to create the Workflow rules as mentionted in the document. So whenever you put the logurl,account name while creating any account.The CRM workflow service calls this dll and it it takes the values from the created account and creates sites in Sharepoint.

Avinish Awasthi

GeneralTrying to get it working Pin
Jabbo13-Dec-07 4:33
Jabbo13-Dec-07 4:33 
GeneralRe: Trying to get it working Pin
Avinish Awasthi17-Mar-08 3:28
Avinish Awasthi17-Mar-08 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.