Muhammad Ali Khan

MS CRM 3.0, MS CRM 4.0, Sharepoint 2007 & Sharepoint 2010

Archive for January, 2010

Virtual Machine For SharePoint 2010

Posted by Ali Khan on January 27, 2010

Brief Description

This download contains a two Virtual Machine set for evaluating and demonstrating Office 2010 and SharePoint 2010.

System Requirements
  • Supported Operating Systems: Windows Server 2008 R2; Windows Server 2008 R2 Enterprise; Windows Server 2008 R2 Standard

In order to run this demo you will need the following: – Windows Server 2008 R2 with the Hyper-V role enabled. – Drive Formatting: NTFS – Processor: Intel VT or AMD-V capable – RAM: 8 GB or more recommended – Hard disk space required for install: 50 GB

Source:-  Microsoft SharePoint 2010 Virtual Machine

Posted in Sharepoint 2010, Sharepoint Foundation 2010 | Tagged: | Leave a Comment »

Using Business Connectivity Services(BCS) In SharePoint 2010 For Connecting To MS CRM 4.0

Posted by Ali Khan on January 24, 2010

In this post i will create a custom BCS .net connector (for SharePoint 2010) in Visual Studio 2010  to connect to MS CRM 4.0 and perform the basic CRUD(Create, Retrieve, Update, Delete) operations on the MS CRM “Account” Entity.

Source Code:- You can Download the Source Code of this Project From Here, Source Code.

Step 1:- Create a Custom .Net BCS Project In VS2010 For MS CRM 4.0

As First Step, Open VS 2010 (Beta 2 Ultimate Edition), Go to File==>New==>SharePoint 2010 ==> Business Data Connectivity Model Project.

Since VS2010 has the built in support for editing the application definition file, it will give me a nice GUI BDC Editor, After renaming the default “Entity1” and adding CRUD methods, it will look like this.

image

You can use the “BDC Method Details” window (the 2nd window in the above diagram) to create new Methods, as shown in the diagram below.

image

There is also the BDC Explorer on the right side. You can use the BDC Explorer to create “Methods In & Return Parameters” Here is how it look like.

image

Simply right click on the parameter name and click on “Add Type Descriptor” and then you can define the “Account” entity, as shown below.

image

If you want to use the VS2010 BDC Editor, Here is a good article as a starting point on how to use the editor (Building a BDC Model using the .NET Assembly Connector). But i personally like the XML Editor more as i find more flexibility in it. So to open the XML Editor, Right Click on your Model File (MSCRMBdcModel.bdcm) in “Solution Explorer” and click “Open With” a “XML Editor”  to bring the Model XML Editor.

image

Here is how it looks like.

image

And here is our “Account.cs” Entity.

image

And the Implementation of all the “CRUD” Methods from MS CRM 4.0 in “AccountService.cs”

image

Now from the Solution Explorer, right click and click “Deploy”, it will package the solution and deploy the External BCS Content Type on the your SharePoint 2010 site. (Remember to change the SharePoint site URL in the project properties window)

image 

This is how it looks like in the “Central Administration”. you can configure permission on it by click on the drop-down menu and select “Permission”.

image

Step 2:- Configure External Content Type Profile Page In Centeral Administration

Now go to Central Administration ==> Application Management ==> Service Application ==> Business Data Connectivity and click “Manage” from the top Ribbon. You will see the screen below,

image

Click “Edit” from the Ribbon and select “Configure” to configure the path for the “Profile Page” and click ok. See the diagram below.

image

Generate the profile page for the External Content Type “Account” by click on the dropdown ==> “Create/Upgrade Profile Page”.

image

So Now if you browse to any MS CRM Account with the above URL (e.g. http://win-1r2gn7r1jaq:8000/_bdc/MSCRMBdcModel_BdcModel1/Account_1.aspx?AccountID={ADE922F4-6C06-DF11-BF5A-001E8CFDD686}), you will get a profile page for the MS CRM Account as shown below.

image

Step 3:- Create a “External Content Type” List To Host MS CRM 4.0 Account

Browse to the site, where you deploy the solution, go to Site Actions==> More Options ==> List ==> “External List” ==> Create. Here Select the “External Content type”, as show below, and click “Create”.

image

Now the list will shows all the accounts from MS CRM 4.0, as shown below.

image

Off course you can always change the List View and remove the “AccountID”, as it is a Guid and there is no point in showing it to the end user. Here is how it looks like now.

image 

Step 4:-  Using SharePoint 2010 Designer to Create the “New”, Edit Form for our External Content Type

If you click on “Add new Item” now, it will throw an error because the create and edit page doesn’t exit for the list. So lets create the “New” & “Edit” form for our list in SharePoint 2010 Designer.

Open your site in SharePoint 2010 Designer ==> List and Libraries ==> click “CRM Accounts” (Your external list) to see the diagram below.

image

As you can see there are now “Create” and “Edit” Forms in the “Forms section”. So click “New” in the form section to open up the dialog box as shown below (for the “Create Account”) and click ok.

image

Do the same for the “Edit Account”, but this time select “Edit item form”, your forms section will now look like this.

image

Now click on the “EditAccount.aspx” page and modify the view. Here in SharePoint 2010 Designer, you can decide which field to show and which one to hide from the end user. Here is how the “EditAccount.aspx” looks like in SharePoint 2010 Designer (after editing). As you can see we have deliberately hide the “Account ID” (a Guid) and Parent Account (A MS-CRM Lookup) on the Edit Form.

image

Save the forms. Now browse to your list (MS CRM Accounts) in the SharePoint site. Here is how the “Create Account” looks like.

image

And Here is “Edit Account” and “Delete” option. You can see below the “Account ID” and “Parent Account” are not visible as we removed these field in the SharePoint 2010 Designer.

image

Oh Yes, and here is how it looks like in MS CRM 4.0

image

With this example, now you can perform all the basic operations CRUD( Create, Retrieve, Update, Delete) on MS CRM Account inside your SharePoint 2010 Portal, thus opening new opportunities for integration between MS CRM 4.0 and SharePoint 2010 Portal.

That’s all folks.

Posted in BCS, Bussiness Connectivity Services, MS CRM 4.0, Sharepoint 2010, SharePoint 2010 Designer, Sharepoint Foundation 2010 | Tagged: , | 13 Comments »

Add More Values to Duration(Drop-Down) In MS-CRM 4.0 Task Entity

Posted by Ali Khan on January 24, 2010

In this small post, i will show you how to add more options(Values) to the Standard “Duration” drop-down in the “Task” Entity. So, out of the box, the “Duration” field on the “Task” entity look like this.

image

Note:- “Duration” Field is not a MS CRM Pick-List. It is editable and user can add anything e.g. “4 Days”, “52 Minutes” etc. In fact the data type of the “Duration” field is “Integer”. but in Task entity it looks like a Standard MS CRM Pick list. In-Background MS CRM is generating a table for this field and displaying the values in the drop-down. See the attribute description below:-

image

So to add more values to the “Duration” drop-down, put the following JavaScript code in the Task Entity Form ==> OnLoad() event, save the form and publish the “Task” entity. The code is simply adding rows to the table, which is used to display the “Duration” drop-down on “Task” Entity Form.

var obj = document.getElementById('actualdurationminutesSelect');
var tbl = obj.childNodes[1];
var lastRow = tbl.rows.length;
var row = tbl.insertRow(lastRow);
var cell = row.insertCell(0);
cell.val = '4 days';
cell.innerText = '4 days';
lastRow++;
row = tbl.insertRow(lastRow);
var cell = row.insertCell(0);
cell.val = '5 days';
cell.innerText = '5 days';

After publishing the “Task” entity, the “Duration” drop-down now look like this, with values “4 days” & “5 days” coming inside the default drop-down.

 image

That’s all folks !!!

Posted in MS CRM 3.0, MS CRM 4.0 | Tagged: | 3 Comments »

Update Rollup 8 for Microsoft Dynamics CRM 4.0 is available

Posted by Ali Khan on January 21, 2010

INTRODUCTION

Update Rollup 8 for Microsoft Dynamics CRM 4.0 is available. This article describes the hotfixes and the updates that are included in this update rollup. This update rollup is available for all languages that are supported by Microsoft Dynamics CRM 4.0.

MORE INFORMATION

The build number of the update rollup packages for the Microsoft Dynamics CRM 4.0 server, for the Microsoft Dynamics CRM 4.0 client for Microsoft Office Outlook, and for the Microsoft Dynamics CRM 4.0 E-mail Router is 04.00.7333.2542.
The file names for the 32-bit versions of the update rollup packages are as follows:

  • CRMv4.0-KB975995-i386-Server-LangID.exe
  • CRMv4.0-KB975995-i386-Client-LangID.exe
  • CRMv4.0-KB975995-i386-Router-LangID.exe
  • CRMv4.0-KB975995-i386-DMClient-LangID.exe
  • CRMv4.0-KB975995-i386-SRS-LangID.exe
  • CRMv4.0-KB975995-i386-MUI-LangID.exe

The file names for the 64-bit versions of the update rollup packages for the Microsoft Dynamics CRM 4.0 server and for the Microsoft Dynamics CRM 4.0 E-mail Router are as follows:

  • CRMv4.0-KB9759952-amd64-Server-LangID.exe
  • CRMv4.0-KB975995-amd64-Router-LangID.exe
  • CRMv4.0-KB975995-amd64-SRS-LangID.exe
  • CRMv4.0-KB975995-amd64-MUI-LangID.exe

Source:- Rollup 8 Microsoft CRM

Posted in MS CRM 4.0 | 1 Comment »

Me @ Microsoft CRM & CRM-Development Forum

Posted by Ali Khan on January 14, 2010

image

CRM Threads:-

Posted in Personal | Leave a Comment »

Hurraah !!! Got A Seat For “25 seats for SharePoint 2010 Virtual Ignite GMT+4 Time zone: Limited”

Posted by Ali Khan on January 13, 2010

This week, i got an invitation from Microsoft for a Virtual Ignite Training On SharePoint 2010 from 25th to 29th Jan 2010.

image

Here is the event details :-

We have a rare opportunity available for partners in the Middle East, Africa and Europe to attend SharePoint 2010 Virtual Ignite in your time zone! 25 seats are open for the GMT+4 time zone for a 5 day Virtual Ignite training starting Jan 18, 2010. Given previous experiences, we expect the seats to go quickly and we will not be able to accommodate all requests to attend. There are two tracks…

Source:- http://tweetmeme.com/story/420479626/microsoft-sharepoint-team-blog-25-seats-for-sharepoint-2010-virtual-ignite-gmt4-time-zone-limited-availability-till-jan-9-2010

Really looking forward for the event.

Thanks Microsoft 🙂

Posted in Sharepoint 2010, Sharepoint Foundation 2010 | Leave a Comment »

Business Connectivity Services (BCS) Using WCF & SharePoint Designer 2010

Posted by Ali Khan on January 11, 2010

In this post, I will consume a simple WCF service in SharePoint 2010 Designer and create an external content type (formerly known as Entities in BCD).

Step 1:Create the WCF Service & Deploy In IIS

My First step is to create the WCF service. There is nothing fancy about the code, I have one simple “Project” Contract with CRUD methods defined (that later I will consume in BCS), these methods are using LINQ to SQL to my test SQL Server Database (ProjectDB). Here is the WCF Contract.

image

And here is its implementation

image

You can download the full code (along with the application definition file from here “Download Code, you can import this application definition file from the Central Administration).

Step 2: Create External Content Type In SharePoint Designer 2010 From WCF Service

After deploying the WCF service in IIS, now let’s move to SharePoint 2010 Designer and create the BCS External Content type from this WCF Service. Open any site in SharePoint 2010 Designer ==> Click External Content Types.

image

Click “External Content Type” in the Ribbon to create a new External Content type. Fill the “Name” and other properties as shown below.

image

Click the line “Discover external data source and define operations” and in the new screen, click “Add Connection” and select “WCF Service”.

image

Fill in the properties “Service Metadata URL”, “Service Endpoint URL” and namespace and the click ok. It will download the metadata from the WCF contract and generate the BCS External Content Type for you.

 imageAfter click ok, the external content type from WCF will look like this. Now you have to define the operations for this external content type.

image

Now one by one, you will generate the method for CRUD (Create, Retrieve, Update, and Delete) and Retrieve List. Here is the step by step procedure for the create method. Right click “Create” and select “New Create Operation”, a wizard will open up.

image

image

image

Now Click “Finish”, it will generate the “Create Method” for this external content type. Similarly, generate the method for other operations. Now your “External Content Type” will look like below,

image

Save the “External Content Type”, by pressing “Save Icon” in the SharePoint 2010 Designer at the top.

image

Step 3: Configure External Content Type Profile Page in Central Administration

Now go to Central Administration ==> Application Management ==> Service Application ==> Business Data Connectivity and click “Manage” from the top Ribbon. You will see the screen below,

image

Click “Edit” from the Ribbon and select “Configure” to configure the path for the “Profile Page” and click ok. See the diagram below.

image

Generate the profile page for the External Content Type “WCFProject” by click on the dropdown ==> “Create/Upgrade Profile Page”.

image

So Now if you browse to any project with the above URL (e.g. http://win-1r2gn7r1jaq:8000/_bdc/AliProjects_WCFSP2010/WCFProject_1.aspx?ProjectID=9e02b936-2d41-4031-a2f0-6b8e8c6367e8), you will get a profile page for the project as shown below.

image

Step 4: Displaying WCF Service Data In SharePoint List

Now we will create an “External List” to consume this data from WCF Service  as shown below.

image

image

Select the “External Content Type (WCFProject)” and click “Create” to create the list. It will pull the listings for all the projects from the WCF “ReteriveMultiple” Method as shown below.

image

Now you can “Create”, “Update”, “View” and “Delete” any “Project” and it will call WCF Method internally to perform the operation. See the example of the delete below.

image

Here is the “Create” form.

image

In Brief, With SharePoint 2010, now we can easily create connect our existing WCF Service with the SharePoint and display, edit,create and delete the data inside the portal.

That’s it :).

Posted in BCS, Bussiness Connectivity Services, Sharepoint 2010, SharePoint 2010 Designer, Sharepoint Foundation 2010, WCF | Tagged: | 11 Comments »