Everybody loves to use InfoPath forms. And let’s face it, we all wish we could just take them and put them into CRM. What I’ve written is a simple way to do that without the hassle of figuring out how to bind the InfoPath form schema to a custom WCF service. It still doesn’t do everything I want it to, but it works, so I figured I’d go ahead and put it out there for everyone to look at, play with, and even use.
If you are interested in this solution, you can download the following:
- Managed Solution (this is the only thing you need)
- Unmanaged Solution (in case you want to modify mine, like add grid support, it is on my to-do list)
- Source Code (this is in case you would prefer to use a WCF service or if you just want to play around with my code)
Once you’ve installed the managed solution, you’ll need to do the following to create / setup an InfoPath form:
-
For this particular InfoPath integration, you need to create InfoPath Forms that mirror a CRM Entity.
Note: You can always create a new entity for the form data.
-
Rename the default form Group to the name of the entity (ex: Contact)

-
Inside CRM create the InfoPath form (it is an entity included in the solution), select the entity and save the form.

-
Once it has been saved, you can copy the ID using the “Copy ID” link in the header.
Note: If you do not select the Allow Any CRM Field checkbox, you will need to add the individual Fields, which can be found in the left navigation. -
In the InfoPath Form Designer, add a field named SubmissionCode with the Default Value as the ID you just copied.
Note: Using the submission code allows us to check and see if the form is valid, active, and allowed.
-
Add a field for each of the fields in CRM that you want to be available, selecting the appropriate data type.
Note: Unfortunately I have not had the time to test the fields and have been using the checkbox on the infopath form record to enable any/all CRM fields. However, I did not want to delay releasing the code and information as it currently is. If someone identifies a problem with this or any other section of the code, I’ll be happy to look into it and work on resolving the issue.
-
Layout the fields on the form, then click File > Submit Options > To Email

-
Enter the Queue email or where you want new forms to be submitted.

-
Click Next.

-
Click Finish.

- Save and close the form designer.
-
Open the form and test submission.

Once the email comes into CRM, the process of reading the form is easy; you just open it up and click the
Import InfoPath button on the ribbon.
Usually I would post the source-code and comment on how it works in great detail, but this time, it really depends on which component. There is a plugin and WCF service written in C# as well as two Jscript files, one for the buttons and one for the InfoPath form inside CRM that creates a drop-down of the entities in CRM. I would suggest downloading the unmanaged solution and source-code if you want to delve into those items.
Now, for complex situations or form conversions, binding the InfoPath schema is the way to go. Using that method (the one described in detail on Philo’s Weblog) you can import the InfoPath form schema into Visual Studio:
- Create an InfoPath form and lay it out the way you want it.
- Extract the form files (File | Extract Form Files) to a location you can find later.
- Close the InfoPath form designer.
- Open the Visual Studio command prompt.
- Change to the directory where you extracted the files
cd c:\myinfopathfiles
- Run xsd against the myschema.xsd in that directory, and specify the namespace you would like to use.
Note: My WCF namespace is CrmInfoPathService and my plugin namespace is InfoPathPlugin.
xsd.exe myschema.xsd /classes /l:cs /n:InfoPathPlugin
- Then you can deserialize the xml into the object and store it in CRM or any other system using the logic embedded in your code.
The key point to my solution was not to do something that everyone does on occasion, but to make something so that I can leverage it in the future and not have to create a new integration every time I wanted to leverage a new form. Now, on that note, here are the list of things that if you delve into, I’d like to know, a.k.a. my to-do list for this project:
- Add a button onto the grid for activities
- Create a way to handle child entities.
- Modify the plugin/WCF code to link the created entities to the form email using connections.
- Change the button on the form to monitor for the results (success/failure) and report back to the user.
- Any great ideas my readers think should be added!

Hey!
Thanks for the nice tutorial, but I am having problems following your solution. I am running a 30-day trial of MS Dynamics 2011 Online and I have successfully installed the solution in the CRM. I have created a sample InfoPath form and sent it to my email address (so all steps from your tutorial went absolutely fine). I have CRM for Outlook 2010 installed, but I am unable to find ‘Import InfoPath form’ button on the ribbon (so I am stuck on the very last step of your tutorial). When I try to Track a form in CRM I get an error saying that this item cannot be tracked in the CRM. So what I get in the end is the form inside my inbox and that’s it
Any help would be greatly appreciated! Thanks!
M.
I’ll have to rerun through the test to see how it functions inside of outlook since it is bringing up the form. If the attachment was being read without the outlook client into CRM, and you opened the email activity in CRM you’d be able to click a button to import the attached form.
Hey,
I have registered for an online trail version of crm 2011 and installed the solution which you have provided and created a Queue in CRM with the Live ID as the primary Email which i am using it as login id for CRM 2011 but even after submiting the Infopath Form it is not coming to CRM but it is in the inbox of the Live ID is there any other process to get the infopath to CRM.
Any help!!!!
You would have to use the outlook client to get the email into CRM, once the email is in CRM you should be able to import it. If that doesn’t work you could setup a wcf service (which is also included in the code) to accept the form and submit it to CRM. Sai, I’d be happy to look at what you are trying to do in more detail so that I can get it working for you, let me know if you want more assistance and I’ll reach out to you.
Hi Carlton,
Great idea, can be extremely useful!
I having a an issue:
I am receiving the emails with filled InfoPath forms in my inbox (CRM outlook client installed), but when I click on “Track” button on the email I am receiving, it shows an error message: “The selected item cannot be tracked in Microsoft Dynamics CRM”
Is there anything I am missing?
Cheers,
Taj
If you are having the emails go to a queue (where the form.xml gets automatically attached to the crm email) I think it works. The only other thing I could think of is to either use the web-service to upload the forms, or write an office extension to provide the outlook click to convert them (all my emails were being tracked in CRM when I was doing it, sans Outlook client).
Hi,
It looks great.. but I’m here for something else
I’ve notice you have on the CRM form header the section: “ID: {GUID} copy it”.
Some of our project managers would love to know how to do it.
Have you ever posted it?
Great blog by the way..
Yair,
I just posted it on my blog for you.
-Carlton
Hi Carlton,
Very useful blog on infopathforms.
Please update me with new blogs on infopath forms.
Do you provide project support?
Thank you,
Sam
I do not provide project support. I provide my blog as an as-is example of how some things can be accomplished.