Microsoft CRM Xrm SDK
Xrm Web Services
Create CRM Records from a Web Page
February 19, 2011, by Bill Bonofiglo, Dynamics MCT
Don't miss the related article Managing Customer Records.

Abstract
Create a web form for a Microsoft Xrm Contact using Visual Web Developer Express 2008 on a production server. The form mirrors a CRM Contact record.
Using the advanced developer extensions, found in the 4.0.12 SDK, the C# Xrm code creates a new Contact record when the User clicks
Submit from a custom landing page.
The code also creates a new Xrm Lead, sets the Lead Source picklist and links it to the Contact via the Originating Lead field.
A simple workflow finishes the job by changing the Lead Status to Qualified.
Xrm vs CRM
What is Xrm you ask? The X equals "anything." Instead of Customer Relationship Management it implies Anything Relationship Management.
"X" broadens the definition of "Customer." For example, is a hospital patient a "Customer?" Well, the hospital
is an Account/Company and the patient is a Contact/Customer - thus Patient Relationship Management, or Xrm.
Related Xrm Article
This article (now) may be considered part 2 of the
Managing Customer Records
article. In that previous article, we discussed the benefits of a custom CRM landing page to create Microsoft CRM records without writing directly
to the CRM database. It simply sends an HTML email.
Reading both articles is not required. However, the first article provides some relevant decision making information. It is worth a read before or after this article.
This Article
This landing page example uses the Advanced Developer Extensions Xrm tools in the CRM 4.0.12 SDK (Software Development Kit) from Microsoft to create
records in the CRM database.
The Big Picture
Before we get technical, let’s be practical. Collecting Customer information via a website landing page is valuable.
Very valuable. Do a webinar, or Campaign, and point a Customer to an exact web page. A few simple questions later and voila...CRM nirvana.
The record is automatically created and subject to anything CRM workflow can do. Sweet!
The following highlights how this Xrm solution works.
- A Customer answers a few questions on a custom landing page.
- Clicking Submit creates a new Xrm Contact & Xrm Lead.
- The C# code queries Accounts to find a match.
- Match found = sets "Parent Customer" link on the Contact.
- No match found = stores the value in a CRM field for reference.
- The C# code sets the Lead Source on the Lead created.
- The C# code sets the Originating Lead link on the Contact.
- A simple CRM Workflow changes the status of the Lead to Qualified.
We now have a new Xrm Contact, linked to both the Originating Lead and the Account records. The Xrm Lead stores the very valuable Lead Source as well.
All this, automatically, with the click of a button on a custom landing page. Again, Sweet! Pure Xrm at its finest.
Who can Benefit
Any Company using Microsoft Dynamics CRM that wants to use custom interactive landing pages to instantly create quality CRM records
will find this very valuable.
How to Get This Solution
This solution is part of our Microsoft CRM Consulting Services. To learn more about how this solution can be deployed for your company, please contact Bill today using the
Contact web page (top right tab).
Thank You
Bill Bonofiglo
Dynamics MCT / MCP / CIS Instructor
Xrm Contact
Outlook Contact