I received an e-mail last week with a link to a product that will take an e-mail and generate a lead in Microsoft Dynamics CRM. One of the people in the office said that would be really cool. We have some forms on our web site that get e-mailed to us. We could simply select the e-mail and say “create a lead”. It sounded like a reasonable business request. But then I asked, why is the web site e-mailing you the form data? Why not simply write the form straight to Microsoft Dynamics CRM? Then we can process the new Lead using our workflow process.
This is a very simple process to connect to Microsoft Dynamics CRM from a ASPX web page and generate a new lead.
The process to do this is very straight forward. I created a class called leadwrite. I have a main method called write(). It has many arguments for each attribute we capture on the form. The method simply validates the arguments. If everything is valid it connects to our CRM and creates a CRMService object. Using this object we can create a new lead.
There is no reason to post all the code in a blog. If you’re interested in the code, test out one of our Forms and we will send it to you. Submit a form on our web site and request the code from this blog.
You can test on your own project. Set the web config properties and create a web form. Add the attributes we collect to your form (or modify the code to collect any attributes you require). Collect the arguments form the screen and call the leadwrite class. That’s it. Done.