Archive for November, 2010

Importing Excel data into InfoPath

November 29, 2010

There is always a need to create a InfoPath forms from Excel. Now this can be bit more trickier. Again there are be couple of different approaches:

1) Using workflow activities to copy List data to InfoPath forms: First part of this exercise is to create a SharePoint List from a Spreadsheet. Second part of the process is to generate and update the InfoPath forms in a form library. You can accomplish this by following steps:

a) You will have to prepare the form library to take data. Specifically you will have to promote all the fields in the form that needs to be updated as site columns. This has some serious performance issues.

b) Create a black InfoPath by hitting new button on the form library.

c) Download it on your local machine by choosing “Download a Copy” option in the listitem menu.

d) Make multiple copies of this form (one per record in your spreadsheet).

e) Rename and upload the forms. This is most effectively done with the “Explorer view” of form library. Other options is to use “Upload Multiple Files” from list menu or in SharePoint Designer.

f) Now Write a SPD workflow for the SharePoint list which was created by getting data from spreadsheet and coping it over to the corresponding column in the Form Library (that is the reason to expose the column). You can use “Update List Item” activity to do this.

g) Trigger the update on each row of SP list so it copies the data in the InfoPath form.

Now there can be some serious issue if you can more than 40 columns in the sheet. Limitation occurs with Form Library promoted columns. As you promote more and more columns it will take more time to publish the form template. The web service that publishes the Form Templates starts to timeout and you will not be able to publish the forms.

There is a CodePlex Activity “Set InfoPath field inner text” available to get around this issue. This activity basically allows you to copy text directly into the form.

2) I have not tested this approach but this can be every simple thing to do. I came across Qdabra’s Excel to InfoPath Migration Tool . This tool looks quit promising to me as it uses very simple approach to generate the xml per record in the Spreadsheet. Mapping also looks easy it uses one xml file to map excel sheet columns to Form fields.

Error message when you upgrade from Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.0: “The E-mail Router Configuration Manager was unable to retrieve user and queue information from the Microsoft Dynamics CRM server”

November 26, 2010

Consider the following scenario:

  • You upgrade from Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.0.
  • You configure the Microsoft Dynamics CRM 4.0 E-mail Router for an organization.
  • You click Load Data.

In this scenario, you may receive the following error message:

The E-mail Router Configuration Manager was unable to retrieve user and queue information from the Microsoft Dynamics CRM server. This may indicate that the Microsoft Dynamics CRM server is busy. Verify that URL ‘http://organization name’ is correct. Additionally, this problem can occur if specified access credentials are insufficient. To try again, click Load Data. (The request failed with HTTP status 404: Not Found.)

This problem occurs if the following conditions are true:

  • The ADSdkRootDomain value and the ADWebApplicationRootDomain value are set to the server name.
  • Microsoft Dynamics CRM is configured to use the host headers.

To resolve this problem, follow these steps:

  1. Download the Microsoft Dynamics CRM Deployment Configuration tool. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

How to use the Microsoft Dynamics CRM Deployment Configuration tool for Microsoft Dynamics CRM 4.0

  1. To check the values that are currently set, run the following query on the Microsoft Dynamics CRM configuration (MSCRM_Config) database.
SELECT Id, ColumnName, NvarCharColumn From DeploymentProperties
WHERE ColumnName IN ('ADSdkRootDomain','ADWebApplicationRootDomain')
  1. Use the Microsoft Dynamics CRM Deployment Configuration tool to update the ADSdkRootDomain value and the ADWebApplicationRootDomain value to the host header value. To do this, run the following two commands in the Microsoft Dynamics CRM Deployment Configuration tool.
microsoft.crm.deploymentconfigtool.exe addresssettings update -sdkrootdoamin: <host header value>
microsoft.crm.deploymentconfigtool.exe addresssettings update -webapprootdomain: <host header value>
  1. Restart Internet Information Services (IIS), and then restart Microsoft Dynamics CRM Asynchronous Processing Services. To do this, follow these steps:
  2. Click Start, click Run, type iisreset, and then click OK.
  3. Click Start, click Run, type services.msc, and then click OK.
  4. Right-click Microsoft CRM Asynchronous Processing Service, and then click Restart.

Update Rollup 14 for Microsoft Dynamics CRM 4.0

November 24, 2010

The Microsoft Dynamics CRM Sustained Engineering (SE) team released Microsoft Dynamics CRM 4.0 Update Rollup 14 on Thursday, November 18, 2010.

The links below will take you to the necessary information about Update Rollup 14.

General details about Update Rollup 14

Update Rollup 14 is cumulative. However, the Update Rollup 14 CRM Client and Data Migration Client packages require Update Rollup 7 to be installed. For all other CRM components, you do not need to install any previous Update Rollups prior to Update Rollup 14.

The Update Rollup 14 download contains updates for the 40 supported Language Packs. Prior to installing the Update Rollup 14 Language Pack, you must install the original Language Pack. If you have Language Packs installed, you should

  1. Download the Update Rollup 14 Language Pack
  2. Install the Update Rollup 14 Language Pack
  3. De-provision the Language Pack
  4. Re-provision the Language Pack

Information about how to avoid reboots when installing the CRM Outlook Client can be found in the Update Rollup 4 blog posting.  

The Update Rollup 14 Client can be deployed before the server is upgraded to Update Rollup 14.

Steps to make the Update Rollup 14 Client available via AutoUpdate can be found in the Update Rollup 4 blog posting. The Link and Patch IDs can be found in KB article 2389019.

Each update rollup could have fixes that require manual configuration. Please see the “Hotfixes and updates that you have to enable or configure manually” section in KB article 2389019.

How to get support for Update Rollup 14

For support, please contact Microsoft Product Support. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: http://support.microsoft.com/default.aspx?scid=fh;[LN];CNTACTMS.

Note: In special cases, charges ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

CRM 4.0 Email Router Starts then stops Email Pending Send

November 22, 2010

When the email messages are showing as ‘Pending Send’ in CRM, and opening the message shows. The message has not yet been submitted for delivery. For more information, see help. If you look in the services for the email router, you will see it has stopped. Starting the email router, the service will start then stop.

Navigate to: C:\Program Files\Microsoft CRM Email\Service
Find the file: Microsoft.Crm.Tools.EmailAgent.SystemState.xml
Rename or delete the file. Then start the CRM Email Router Service.

Free ebook: Programming Windows Phone 7, by Charles Petzold

November 12, 2010

Gang, we’re done! 24 chapters, about 1,000 pages. Congratulations to Charles, who has outdone himself!

Speaking for Charles and for the Windows Phone 7 team, we hope that you will enjoy Programming Windows Phone 7:

You can download a PDF here (12.5 MB). [NOTE on November 2: The fixed PDF is now available via the link. We have also enabled commenting, which means you can highlight text and add notes. Again, we’re sorry for the hassle!] [NOTE on November 1: we see the blog comments about presentation issues with the ebook. We’ve determined that the PDF is missing a required embedded font. This is leading to odd (or worse) presentation for some of you, including bitmapped text. We’re working with the vendor to create a new file. I’ll let you know when the new file has replaced the old one in the Microsoft Download Center. We apologize for this!]

You can download an XPS here (26.7 MB).

And you can download the ebook’s sample code here (5.03 MB).

To give you a sense of this offering, here is Charles’s Introduction—beneath that you’ll find the ebook’s full Table of Contents:

Introduction

This book is a gift from the Windows Phone 7 team at Microsoft to the programming community, and I am proud to have been a part of it. Within the pages that follow, I show you the basics of writing applications for Windows Phone 7 using the C# programming language with the Silverlight and XNA 2D frameworks.

Yes, Programming Windows Phone 7 is truly a free download, but for those readers who still love paper—as I certainly do—this book will also be available (for sale) divided into two fully-indexed print editions: Microsoft Silverlight Programming for Windows Phone 7 and Microsoft XNA Framework Programming for Windows Phone 7. [Note from Devon: we should have these ready for order in December 2010.]

With the money you’ve saved downloading this book, please buy other books. Despite the plethora of information available online, books are still the best way to learn about programming within a coherent and cohesive tutorial narrative. Every book sale brings a tear of joy to an author’s eye, so please help make them weep overflowing rivers.

In particular, you might want to buy other books to supplement the material in this book. For example, I barely mention Web services in this book, and that’s a serious deficiency because Web services are likely to become increasingly important in Windows Phone 7 applications. My coverage of XNA is limited to 2D graphics and while I hope to add several 3D chapters in the next edition of this book, I don’t really get into the whole Xbox LIVE community aspect of game development. Nor do I discuss any programming tools beyond Visual Studio—not even Expression Blend.

My publisher Microsoft Press has a couple additional Windows Phone 7 books coming soon: Windows Phone 7 Silverlight Development Step by Step by Andy Wigley & Peter Foot offers a more tools-oriented approach. Although Michael Stroh’s Windows Phone 7 Plain & Simple is a guide to using the phone rather than developing for it, I suspect it will give developers some insights and ideas.

Moreover, I also hear that my old friend Doug Boling is working hard on a Windows Phone 7 enterprise-programming book that is likely to be considered his masterpiece. Be sure to check out that one.

Organization

This book is divided into three parts. The first part discusses basic concepts of Windows Phone 7 programming using example programs that target both Silverlight and the XNA framework. It is likely that many Windows Phone 7 developers will choose either one platform or the other, but I think it’s important for all developers who have at least a little knowledge of the alternative to their chosen path.

The second part of this book focuses entirely on Silverlight, and the third part on XNA 2D. For your convenience, the chapters in each part build upon previous knowledge in a progressive tutorial narrative, and hence are intended to be read sequentially.

My Assumptions About You

I assume that you know the basic principles of .NET programming and you have a working familiarity with the C# programming language. If not, you might benefit from reading my free online book .NET Book Zero: What the C or C++ Programmer Needs to Know about C# and the .NET Framework, available from my website at www.charlespetzold.com/dotnet.

System Requirements

To use this book properly you’ll need to download and install the Windows Phone Developer Tools, which includes Visual Studio 2010 Express for Windows Phone, XNA Game Studio 4.0, and an on-screen Windows Phone Emulator to test your programs in the absence of an actual device. Get the latest information and downloads at http://developer.windowsphone.com.

You can install these tools on top of Visual Studio 2010, in effect enhancing Visual Studio 2010 for phone development. That’s the configuration I used.

Although you can do quite a bit with the phone emulator, at some point you’ll want to deploy your programs to an actual Windows Phone 7 device. You can register as a phone developer at http://developer.windowsphone.com and then have the ability to unlock your phone so you can deploy your programs from Visual Studio.

Since late July 2010, I’ve had an LG GW910 phone to test the programs in this book. For the record, the final build I installed was 7.0.7003.0.

Using the Phone Emulator

Windows Phone 7 supports multi-touch, and working with multi-touch is an important part of developing programs for the phone. When using the Windows Phone Emulator, mouse clicks and mouse movement on the PC can mimic touch on the emulator, but for only one finger. You can test out multi-touch for real on the phone emulator if you have a multi-touch monitor running under Windows 7.

In the absence of a multi-touch monitor, you might want to explore simulating multi-touch with multiple mouse devices. The site http://multitouchvista.codeplex.com has the download you’ll need and includes a link to http://michaelsync.net/2010/04/06/step-by-step-tutorial-installing-multi-touch-simulator-for-silverlight-phone-7 that provides instructions.

Windows Phone 7 devices also have a built-in accelerometer, which can be very difficult to simulate in an emulator. Per Blomqvist, the Technical Reviewer for this book, found an application at http://accelkit.codeplex.com that utilizes the webcam and ARToolkit to emulate the accelerometer sensor and feed that data into the Windows Phone 7 emulator through a TCP/HTTP Server, and although neither of us have tried it out, it sounds quite intriguing.

Code Samples

To illustrate Silverlight and XNA programming concepts, this book describes about 190 complete programs. Many of them are small and simple, but others are larger and more interesting.

Some people like to learn new programming environments by re-creating the projects in Visual Studio and typing in the source code themselves from the pages of the book. Others prefer to study the code and run the pre-existing programs to see what the code does. If you fall into the latter category, you can download all the source code in a ZIP file. The location of this ZIP file is available from my website at www.charlespetzold.com/phone and from the Microsoft Press blog at http://blogs.msdn.com/b/microsoft_press/.

If you find something in the code that is useful in your own software project, feel free to use the code without restriction—either straight up or modified in whatever way you want. That’s what it’s there for.

Free ebook: Moving to Microsoft Visual Studio 2010

November 10, 2010

Developers, we’re pleased to announce another free offering: Moving to Microsoft Visual Studio 2010 (Microsoft Press, 2011; 336 pages), written by Patrice Pelland, Pascal Paré, and Ken Haines.

Here’s a little bit about the authors: Ken Haines is a software development engineer at Microsoft, working in the Consumer and Online Division. He has a passion for distributed applications in the cloud and strives to help customers and partners find the right solution for their needs. Pascal Paré has worked at Microsoft since 2006, where he has held positions as a software engineer on both development and testing teams. Patrice Pelland is a principal development manager at Microsoft, working in the Consumer and Online Division. He leads a development team that is focused on innovation and incubation across all Microsoft consumer products.

Moving to Microsoft Visual Studio 2010 was written with three audiences in mind:

Part I is for developers moving from Visual Studio 2003 to Visual Studio 2010.

Part II is for developers moving from Visual Studio 2005.

And Part III is for developers moving from Visual Studio 2008.

Please see this post for an extensive description of the book’s content, including “Who Is This Book for?,” “What Is the Book About?,” and “How Will This Book Help Me Move to Visual Studio 2010?” (Note that the links in that post are to a draft preview version of the book. Links to the final and complete book appear immediately below in this post.)

You can download a PDF of the book here.

You can download an XPS of the book here.

And you can download the book’s sample code here.

Enjoy!

Your complete guide to virtualisation as a free download

November 8, 2010

Let me make it absolutely clear – I am not a virtualisation expert. But I have heard enough network managers in schools, colleges and universities talking about their virtualisation projects to know that it’s very important to their ICT infrastructure – whether that’s reducing cost, cutting carbon emissions, managing their workload, or improving their network reliability and service levels.

But I’ve also talked with other IT managers who’ve convinced me that it’s specialist knowledge that isn’t widely shared. After all, if you’re not quite sure what the difference is between server virtualisation and desktop virtualisation, or whether ‘virtualisation’ and ‘moving to the cloud’ are the same thing, then it can be awkward to ask. (A bit like when I sat in a meeting with a school, and was too embarrassed to ask what ‘assessment for learning’ meant. It helped later when I discovered that nobody in the meeting knew, but they all thought everybody else did.)

The answer is to find the perfect reference guide, written in plain English. And for virtualisation I have found it!

It is absolutely massive – 450 pages. And it has only one subject – virtualisation, virtualisation, virtualisation. But the chapter titles tell you that it’s just what you need:

  • Chapter 1 – Why Virtualisation?
  • Chapter 2 – Server Virtualisation
  • Chapter 3 – Local Desktop Virtualisation
  • Chapter 4 – Remote Desktop Virtualisation
  • Chapter 5 – Virtualisation Management
  • Chapter 6 – Cloud Computing

And it’s got a brilliant index too, so that next time somebody says “failover clustering”, you can look it up slyly on your laptop, and join the conversation.

So if you  want to learn more about the latest Microsoft virtualisation technologies, so that you can differentiate your Hyper-V from your Remote Desktop Services, then this is the job. And it also covers Microsoft Virtual Desktop Infrastructure, Microsoft Application Virtualization 4.5, Microsoft Enterprise Desktop Virtualization, Windows Virtual PC and Windows XP Mode, System Center Virtual Machine Manager 2008, and Microsoft’s private and public cloud computing platforms including Windows Azure. (No wonder it needs 450 pages.)

And best of all, the PDF is free, so stick it on your desktop now:

Download it free: Understanding Microsoft Virtualization Solutions: From the Desktop to the Datacenter, 2nd Edition

Microsoft Dynamics CRM SDK 4.0.13 Available

November 5, 2010

The Microsoft Dynamics CRM 4.0 Software Development Kit (SDK) is for developers, system customizers, and report writers.This SDK documentation contains information for developers writing server side code, custom business logic, integration modules, workflow assemblies, and plug-ins. It provides an architectural overview of Microsoft Dynamics CRM, the entity model, security model, and Web services. Sample code and walkthroughs are provided to guide you through the new features. It also contains information for developers customizing the Web client or Microsoft Dynamics CRM for Microsoft Office Outlook, including scripting, integration of custom Web pages, sample code, and a detailed user interface style guide.
This release includes the new Advanced Developer Extensions for Microsoft Dynamics CRM, also referred to as Microsoft xRM. This is a new set of tools included in the Microsoft Dynamics CRM SDK that simplifies the development of Internet-enabled applications that interact with Microsoft Dynamics CRM.

In addition to the documentation, this download package includes the projects for all sample code found in the documentation, and full featured samples that are not included in the documentation. The package includes a visual style guide you can use to make your customizations fit in smoothly, and a style sheet you can use as a basis for your work. There are also tools and helper code provided in this package. Look for regular updates to this SDK!

This SDK Update 4.0.13 is now live for download and in the MSDN library!

In addition to updates of the binaries, we’ve included a new plug-in sample and walkthrough. Read the complete change list in the release history table on the first page.

Creating Custom List Forms for Creating, Editing, or Displaying a List Item

November 4, 2010

You might have noticed that when you create a new list or library in SharePoint, a set of forms get automatically created for creating a new list item, editing a list item, or displaying that list item. When you add a new column to that list, the column automatically gets added to those forms. Where is this code generated? And how can you create your own Create, Edit, and Display forms?
 
If you look in the 12 hive, in the CONTROLTEMPLATES folder, you’ll see a file called DefaultTemplates.ascx. This file is rather huge, and if you open it up, you’ll see snippets of code that define the UI for everything from the label and textboxes you see on the automatically generated forms, to controls that render Blog posts and Calendar views. As we all know, though, it’s a no-no to edit core SharePoint files. (After all, what would happen when a service pack got released? Your changes would be overwritten.) SharePoint allows you to create your own control templates, and put them in a different file. As long as they reside in the CONTROLTEMPLATES directory, and use the SharePoint:RenderingTemplate server control, you can reference the template by the ID you assign it. (If you’re overriding an existing control, just give it the same ID as the control in the DefaultTemplates.ascx file, and SharePoint will automatically override the default template with your own.) (See How to: Override a Default Control Template for more details.)
 
OK, so how do we use this to our advantage? It’s possible to create your own ascx file with your own RenderingTemplate, and reference that template when displaying a form associated with a content type. For instance, when you create a new list item, perhaps you want the fields to show up in two columns of a table, rather than in one long vertical list. You can build an HTML table with two columns in your list, then use the SharePoint:FormField server controls for displaying the list columns that the user will enter their info into. Your code might look like this:
 
<SharePoint:RenderingTemplate ID=”CustomContentTypeCreateForm” runat=”server”>
<Template>
<table width=”100%” cellspacing=”0″ cellpadding=”10″ border=”0″>
<tr>
<td><SharePoint:FieldDescription runat=”server” ID=”TitleDescriptionField” ControlMode=”New” FieldName=”Title” /></td>
<td><SharePoint:FormField runat=”server” ID=”TitleField” ControlMode=”New” FieldName=”Title” /></td>
<td><SharePoint:FieldDescription runat=”server” ID=”FavoriteColorDescriptionField” ControlMode=”New” FieldName=”FavoriteColor” /></td>
<td><SharePoint:FormField runat=”server” ID=”FavoriteColorField” ControlMode=”New” FieldName=”FavoriteColor” /></td>
</tr>
</table>
</Template>
</SharePoint:RenderingTemplate>
(Make sure you have the right registrations at the top of your .ascx page, like the SharePoint assembly registration and the SharePoint control prefix.)

If you have controls in your template that need compiled code to run, such as showing or hiding fields in the template based on the field values, you can add references in the .ascx page to your own compiled web controls. You’ll just need to make sure you add a reference to your compiled web control at the top of the .ascx page, and deploy the dll with your SharePoint solution package.

The next step is to add a reference to your newly-created rendering template to your custom content type. If you take a look at the XML schema for defining a content type, you’ll see a node called XmlDocuments. Inside that, you’ll add an XmlDocument node, inside which you’ll add a FormTemplates node. In the FormTemplates node, you can add a New, Edit, and/or Display node, inside of which you’ll put the ID of the rendering template it should use. See FormTemplates Schema Overview for more information.

Based on the example rendering template described above, your XmlDocuments node might look like this:

<XmlDocuments>
  <XmlDocument NamespaceURI=”http://schemas.microsoft.com/sharepoint/v3/contenttype/forms“>
   <FormTemplates  xmlns=”http://schemas.microsoft.com/sharepoint/v3/contenttype/forms“>
     <New>CustomContentTypeCreateForm</New>
   </FormTemplates>
  </XmlDocument>
</XmlDocuments>

If you would like to associate this content type with a custom list definition, you can do it by adding the content type to the list’s schema.xml file. You would add the content type to the ContentTypes node. If you make this content type the default content type for the list (or the only content type for that matter), it will be the content type that’s automatically used when a user clicks the “New” button on a list’s toolbar. If you’ve created a custom “New” form for that content type, your custom rendering template will be used to render the “New” form the user sees.