<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>CRMBuzz.net</title>
        <link>http://blog.crmbuzz.net/Default.aspx</link>
        <description>Abe Saldana on Microsoft Dynamics CRM Development</description>
        <language>en-US</language>
        <copyright>Abe Saldana</copyright>
        <managingEditor>abraham@CRMBuzz.net</managingEditor>
        <generator>Subtext Version 1.9.4.78</generator>
        <image>
            <title>CRMBuzz.net</title>
            <url>http://blog.crmbuzz.net/images/RSS2Image.gif</url>
            <link>http://blog.crmbuzz.net/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Updated Microsoft Dynamics&amp;reg; CRM 4.0 Adapter for Microsoft&amp;reg; BizTalk&amp;reg; Server 2009</title>
            <link>http://blog.crmbuzz.net/archive/2009/09/10/Updated-Microsoft-Dynamicsreg-CRM-4.0-Adapter-for-Microsoftreg-BizTalkreg-Server.aspx</link>
            <description>&lt;p&gt;I just got the news that Updated the Microsoft Dynamics® CRM 4.0 Adapter for BizTalk Server 2009 is now available for public download:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=abd3bb9e-a59a-4eb6-8de8-fb25b77926d7" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=abd3bb9e-a59a-4eb6-8de8-fb25b77926d7&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;This is one great news for me personally, at this time I’m getting ready to work on a project that will require to have connectivity and interchange message information with different implementations.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The Updated Microsoft Dynamics CRM 4.0 Adapter supports multiple versions of BizTalk server, including also the versions for 32- and 64-bit versions&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;BizTalk server 2006 &lt;/li&gt;    &lt;li&gt;BizTalk server 2006 R2 &lt;/li&gt;    &lt;li&gt;BizTalk server 2009 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The documentation will give you detail information related to multiple organizations and internet-faced deployments, but unfortunately the updated version will not support redundant BizTalk server installations (such as load-balanced configurations)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;For more detail information check out the adapter documentation on the file: “Microsoft BizTalk Adapter for Microsoft Dynamics CRM 4-Installation and Usage Guide.docx”&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Abe Saldaña &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.crmbuzz.net/"&gt;CrmBuzz.net&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Everything here, though, is my personal opinion and is not read nor approved before being posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/33.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2009/09/10/Updated-Microsoft-Dynamicsreg-CRM-4.0-Adapter-for-Microsoftreg-BizTalkreg-Server.aspx</guid>
            <pubDate>Fri, 11 Sep 2009 03:43:32 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/33.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2009/09/10/Updated-Microsoft-Dynamicsreg-CRM-4.0-Adapter-for-Microsoftreg-BizTalkreg-Server.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/33.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/33.aspx</trackback:ping>
        </item>
        <item>
            <title>CRM Performance and Optimizations</title>
            <link>http://blog.crmbuzz.net/archive/2009/08/25/CRM-Performance-and-Optimizations.aspx</link>
            <description>&lt;p&gt;I was working on a long project that required to install some 3rd party plug-ins, one of the things that make me field uncomfortable was that the application main screen was based on plug-ins making custom web service calls to get the main information, one of the initial issues I received after installation with the plug-ins and web services calls was that the application was taking a lot of time and then stopped without showing any information on the main screen, long story short I find out that all that was related to 2 main settings on the servers&lt;/p&gt;  &lt;p&gt;Main issues with plug-ins and web service calls that I was not aware:&lt;/p&gt;  &lt;p&gt;1- Need to extend the application timeout for running the plug-ins that make several web services calls&lt;/p&gt;  &lt;p&gt;2- Optimizing the Performance of the windows server&lt;/p&gt;  &lt;p&gt;These 2 issues were easily resolved with a couple of registry settings on the local servers, let’s see what was needed:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt;Extending the Application Timeout&lt;/h2&gt;  &lt;p&gt;The timeout solution required modifications to the registry and modifications to the we.config file&lt;/p&gt;  &lt;p&gt;Registry settings, (you can copy and paste to a text file)&lt;/p&gt;  &lt;p&gt;Windows Registry Editor Version 5.00&lt;/p&gt;  &lt;p&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM]    &lt;br /&gt;"OLEDbTimeout"=dword:00015180     &lt;br /&gt;"ExtendedTimeout"=dword:000f4240&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;OLEDBTimeout &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; According to the requirement of the computer that is running SQL server and the number of customization files, the value can be larger than 86400. &lt;/p&gt;  &lt;p&gt;The value of 86400 is equivalent to 24 hours. (Hex value 0x00015180 = 86400)&lt;/p&gt;  &lt;p&gt;ExtendedTimeout&lt;/p&gt;  &lt;p&gt;Note: Valid range value could be larger than 1,000,000 and not grater than 2,147,483,647 &lt;/p&gt;  &lt;p&gt;Value 1,000,000 = Hex 0x000f4240; 2,147,483,647  = Hex 0x7FFFFFFF)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Web.Config changes&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;lt;httpRuntime executionTimeout=&lt;span class="str"&gt;"300"&lt;/span&gt; maxRequestLength=&lt;span class="str"&gt;"8192"&lt;/span&gt;/&amp;gt;&lt;/em&gt;&lt;/p&gt; &lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;  &lt;p&gt;change to &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;lt;httpRuntime executionTimeout=&lt;span class="str"&gt;"1000"&lt;/span&gt; maxRequestLength=&lt;span class="str"&gt;"8192"&lt;/span&gt;/&amp;gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Resources:&lt;/p&gt; &lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/918609" target="_blank"&gt;http://support.microsoft.com/kb/918609&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc191452067"&gt;&lt;font color="#000000"&gt;Optimizing and Maintaining Application Tier Performance&lt;/font&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p&gt;I found that the documentation for optimizing and maintenance have a lot of tips and resources that initially I didn’t understand, but working with other administrators with more experience they pointed to good things on the documentation, this one help me to resolve the issues related to allow the application to perform a lot better whit heavy load of users and been more responsive when loading the plug-ins and web services calls.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Registry settings, (you can copy and paste to a text file)&lt;/p&gt;  &lt;p&gt;Windows Registry Editor Version 5.00&lt;/p&gt;  &lt;p&gt;[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters]    &lt;br /&gt;"MaxUserPort"=dword:000061A8     &lt;br /&gt;"TCPTimeWaitDelay"=dword:00000078&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Resources:&lt;/p&gt;  &lt;p&gt;Optimizing and Maintaining Microsoft Dynamics CRM 4.0&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ba826cee-eddf-4d6e-842d-27fd654ed893&amp;amp;displaylang=en" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=ba826cee-eddf-4d6e-842d-27fd654ed893&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Microsoft Dynamics CRM 4.0 Performance and Scalability White Papers&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5852B14A-394C-4898-8374-CAF5E6479EB0&amp;amp;displaylang=en" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=5852B14A-394C-4898-8374-CAF5E6479EB0&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Abe Saldaña &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.crmbuzz.net/"&gt;CrmBuzz.net&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Everything here, though, is my personal opinion and is not read nor approved before being posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/32.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2009/08/25/CRM-Performance-and-Optimizations.aspx</guid>
            <pubDate>Wed, 26 Aug 2009 04:10:39 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/32.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2009/08/25/CRM-Performance-and-Optimizations.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/32.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/32.aspx</trackback:ping>
        </item>
        <item>
            <title>CRM Learning Resources</title>
            <link>http://blog.crmbuzz.net/archive/2009/05/07/CRM-Learning-Resources.aspx</link>
            <description>&lt;p&gt;Working on a CRM customization project one of my customer’s employee ask me on how to learn Microsoft Dynamics CRM 4.0, and what public resources are available for him to get for free and learn on his own time, I was recalling some of the  training documentation I was using at the beginning, but after a wile i lost some of the important links, so I resulted to find and publish some of the resources i used, so here is a short list with my personal top 15 resources.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Learning and Implementation&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1ceb5e01-de9f-48c0-8ce2-51633ebf4714&amp;amp;DisplayLang=en"&gt;CRM 4.0 Implementation&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/dd393296.aspx"&gt;Developer Ramp up kit for Microsoft Dynamics CRM 4.0&lt;/a&gt; (Videos)&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5852b14a-394c-4898-8374-caf5e6479eb0&amp;amp;DisplayLang=en"&gt;Performance and Scalability White papers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?familyid=B73912E8-861E-43AE-97B4-72B3E809F287&amp;amp;displaylang=en"&gt;Logical Database Diagrams&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?familyid=3BF7ECDA-7EAF-4F1C-BBFE-CAE19BC8BB78&amp;amp;displaylang=en"&gt;Suggested hardware for deployments of up to 500 concurrent users&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Development Links:&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=82e632a7-faf9-41e0-8ec1-a2662aae9dfb"&gt;Microsoft Dynamics CRM 4.0 Software Development Kit (SDK)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?familyid=2874D878-E28D-4530-A185-4DEE1FCDD12E&amp;amp;displaylang=en"&gt;Microsoft Dynamics CRM 4.0 Deployment Software Development Kit (SDK)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://code.msdn.microsoft.com/crmplugin/"&gt;CRM Plug-In registration Tool&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Diagnostics and Administration&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://blogs.msdn.com/benlec/archive/2008/03/04/crmdiagtool4-for-microsoft-crm-4-0-has-been-released.aspx"&gt;CRM Diagnostics Tool&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://blogs.msdn.com/crm/archive/2008/02/29/microsoft-dynamicstm-crm-4-0-performance-toolkit.aspx"&gt;CRM Performance Tool&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://support.microsoft.com/kb/949256"&gt;Latest Updates and Roll Ups&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Books&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.amazon.com/Programming-Microsoft-Dynamics-CRM-Pro-Developer/dp/0735625948/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1241718372&amp;amp;sr=1-1"&gt;Programming Microsoft Dynamics CRM 4.0 (Pro-Developer)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.amazon.com/Working-Microsoft-Dynamics-CRM-4-0/dp/0735623783/ref=pd_bxgy_b_img_b"&gt;Working with Microsoft Dynamics CRM 4.0&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.amazon.com/CRM-as-Rapid-Development-Platform/dp/0981511813/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1241718475&amp;amp;sr=1-1"&gt;CRM as a Rapid Development Platform&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Abe Saldaña &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.crmbuzz.net/"&gt;CrmBuzz.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Everything here, though, is my personal opinion and is not read nor approved before being posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/31.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2009/05/07/CRM-Learning-Resources.aspx</guid>
            <pubDate>Thu, 07 May 2009 18:00:31 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/31.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2009/05/07/CRM-Learning-Resources.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/31.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/31.aspx</trackback:ping>
        </item>
        <item>
            <title>Converting FetchXML ResultSet to a Business Entity Strong Type</title>
            <link>http://blog.crmbuzz.net/archive/2009/03/20/Converting-FetchXML-ResultSet-to-a-Business-Entity-Strong-Type.aspx</link>
            <description>&lt;p&gt;Recurrently I have the same issue on how to get strong type CRM objects from a FetchXML resultset, so I was looking on the SDK documentation and found that there are new code samples on how to accomplish this behavior indirectly from a conversion process, the classes that will help you converting the Fetch to a QueryExpression are &lt;a href="v4d0_sp5100r_fetchxmltoqueryexpressionrequestclass.htm"&gt;&lt;strong&gt;&lt;font color="#ff8040"&gt;FetchXmlToQueryExpressionRequest&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; and &lt;a href="v4d0_sp5100r_fetchxmltoqueryexpressionresponseclass.htm"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;FetchXmlToQueryExpressionResponse&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; the SDK give you a small taste of the functionallity, only giving you the return QueryExpression, this is the code from the SDK documentation&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;[C#]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="rem"&gt;// Set up the CRM service.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;CrmAuthenticationToken token = &lt;span class="kwrd"&gt;new&lt;/span&gt; CrmAuthenticationToken();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="rem"&gt;// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;token.AuthenticationType = 0; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;token.OrganizationName = &lt;span class="str"&gt;"AdventureWorksCycle"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;CrmService service = &lt;span class="kwrd"&gt;new&lt;/span&gt; CrmService();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;service.Url = &lt;span class="str"&gt;"http://&amp;lt;servername&amp;gt;:&amp;lt;port&amp;gt;/mscrmservices/2007/crmservice.asmx"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;service.CrmAuthenticationTokenValue = token;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;service.Credentials = System.Net.CredentialCache.DefaultCredentials;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&lt;span class="rem"&gt;// Create the request object.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;FetchXmlToQueryExpressionRequest fetch = &lt;span class="kwrd"&gt;new&lt;/span&gt; FetchXmlToQueryExpressionRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&lt;span class="rem"&gt;// Set the Fetch Xml to be converted.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;fetch.FetchXml = &lt;span class="str"&gt;"&amp;lt;fetch mapping='logical'&amp;gt;&amp;lt;entity name='account'&amp;gt;&amp;lt;all-attributes/&amp;gt;&amp;lt;/entity&amp;gt;&amp;lt;/fetch&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;&lt;span class="rem"&gt;// Execute the request.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;FetchXmlToQueryExpressionResponse qe = (FetchXmlToQueryExpressionResponse) service.Execute(fetch);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;pre class="csharpcode"&gt; &lt;/pre&gt;

&lt;pre class="csharpcode"&gt; &lt;/pre&gt;

&lt;p&gt;So I created a helper class to enable the conversion and also to run the QueryExpression and return the BusinessEntity{} array.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; BusinessEntity[] Executefetch(&lt;span class="kwrd"&gt;string&lt;/span&gt; query)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            FetchXmlToQueryExpressionRequest request = &lt;span class="kwrd"&gt;new&lt;/span&gt; FetchXmlToQueryExpressionRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            request.FetchXml = query;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            FetchXmlToQueryExpressionResponse response = (FetchXmlToQueryExpressionResponse)service.Execute(request);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            BusinessEntityCollection items = service.RetrieveMultiple(response.Query);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; items.BusinessEntities;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The implementation is so simple and easy to understand, you send the FetchXML and is converted to a QueryExpression and then the query runs and gets the related CRM strong type object back.&lt;/p&gt;

&lt;p&gt;
  &lt;br /&gt;This is a sample code on how to use the ExecuteFetch method, the code will get all related records for a user  with only the open and not started task records.&lt;/p&gt;

&lt;p&gt;  &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SampleCode2(CrmService service)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            Guid userId = &lt;span class="kwrd"&gt;new&lt;/span&gt; Guid(&lt;span class="str"&gt;"{6997B343-7AA0-DD11-9FDF-001F29E24CD0}"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; fetch1 = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;@"&amp;lt;fetch mapping='logical'&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;  &amp;lt;entity name='task'&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &amp;lt;all-attributes /&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &amp;lt;order attribute='scheduledend' descending='true' /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &amp;lt;filter&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;      &amp;lt;condition attribute='ownerid' operator='eq' value='{0}' /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      &amp;lt;condition attribute='statecode' operator='eq' value='Open' /&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;      &amp;lt;condition attribute='statuscode' operator='eq' value='2' /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &amp;lt;/filter&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;  &amp;lt;/entity&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;lt;/fetch&amp;gt;", userId.ToString());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;            FetchHelper fHelper = &lt;span class="kwrd"&gt;new&lt;/span&gt; FetchHelper(service);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            BusinessEntity[] Response = fHelper.Executefetch(fetch1);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (task myTask &lt;span class="kwrd"&gt;in&lt;/span&gt; Response)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                &lt;span class="kwrd"&gt;string&lt;/span&gt; subject = myTask.subject;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                &lt;span class="kwrd"&gt;string&lt;/span&gt; desc = myTask.description;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;                &lt;span class="kwrd"&gt;string&lt;/span&gt; ownerName = myTask.ownerid.name;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                Guid activityId = myTask.activityid.Value;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;                &lt;span class="kwrd"&gt;string&lt;/span&gt; creationDate = myTask.createdon.date;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt;(myTask.regardingobjectid != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;                {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;string&lt;/span&gt; regardingId = myTask.regardingobjectid.Value.ToString();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;string&lt;/span&gt; regardingIdType = myTask.regardingobjectid.type;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;                }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;        }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;After all this the conversion code was so simple to put together and easy to read, I hope the following code snippet's will work for you, keep in mind that I just put the core of the code, CRM connection objects and class definition are not included you need to create those and then test the code &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Abe Saldaña &lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.crmbuzz.net"&gt;CrmBuzz.net&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Everything here, though, is my personal opinion and is not read nor approved before being posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/30.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2009/03/20/Converting-FetchXML-ResultSet-to-a-Business-Entity-Strong-Type.aspx</guid>
            <pubDate>Sat, 21 Mar 2009 00:02:00 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/30.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2009/03/20/Converting-FetchXML-ResultSet-to-a-Business-Entity-Strong-Type.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/30.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/30.aspx</trackback:ping>
        </item>
        <item>
            <title>Update Rollup 1 for Microsoft Dynamics CRM 4.0</title>
            <link>http://blog.crmbuzz.net/archive/2008/12/01/Update-Rollup-1-for-Microsoft-Dynamics-CRM-4.0.aspx</link>
            <description>&lt;p&gt;Yes! a new update for CRM was out before turkey day, you can find the updates and the description for all the corrections on the following links:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=57c6267b-3b13-49dd-bfed-3cc83633aea7&amp;amp;displaylang=en&amp;amp;tm" target="_blank"&gt;Update Rollup 1 for Microsoft Dynamics CRM 4.0...&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Find detail information on the main changes to CRM and to Email router here is the link:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/default.aspx?kbid=952858" target="_blank"&gt;Details for Update Rollup 1 is available for Microsoft Dynamics CRM 4.0....&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Details on the files you need to look for:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The file names for the x86-based Microsoft Dynamics CRM 4.0 Update Rollup 1 packages are as follows: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;For the Microsoft Dynamics CRM 4.0 Server Update Rollup 1 package, the file name is CRMv4.0-KB952858-i386-Server-INTLexe. &lt;/li&gt;    &lt;li&gt;For the Microsoft Dynamics CRM 4.0 client for Outlook Update Rollup 1 package, the file name is CRMv4.0-KB952858-i386-Client-INTL.exe. &lt;/li&gt;    &lt;li&gt;For the Microsoft Dynamics CRM 4.0 E-mail Router Update Rollup 1 package, the file name is CRMv4.0-KB952858-i386-Router-INTL.exe. &lt;/li&gt; &lt;/ul&gt; The file names for the x64-based Microsoft Dynamics CRM 4.0 Update Rollup 1 packages are as follows:   &lt;ul&gt;   &lt;li&gt;For the Microsoft Dynamics CRM 4.0 Server Update Rollup 1 package, the file name is CRMv4.0-KB952858-amd64-Server-INTL.exe. &lt;/li&gt;    &lt;li&gt;For the Microsoft Dynamics CRM 4.0 E-mail Router Update Rollup 1 package, the file name is CRMv4.0-KB952858-amd64-Router-INTL.exe. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Have fun installing and testing the data and Remember to Backup before installing, (Just in case something happened....)&lt;/p&gt;  &lt;p&gt;Abe Saldana&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.crmbuzz.net"&gt;www.crmbuzz.net&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/26.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2008/12/01/Update-Rollup-1-for-Microsoft-Dynamics-CRM-4.0.aspx</guid>
            <pubDate>Tue, 02 Dec 2008 03:58:58 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/26.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2008/12/01/Update-Rollup-1-for-Microsoft-Dynamics-CRM-4.0.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/26.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/26.aspx</trackback:ping>
        </item>
        <item>
            <title>How to's - Detach an E-mail from a Queue</title>
            <link>http://blog.crmbuzz.net/archive/2008/06/12/How-tos---How-to-Detach-an-E-mail-from-a.aspx</link>
            <description>&lt;p&gt;The E-mail to Case process one of the final steps is to make the e-mail not to display on the Queue, that is called detaching from the queue, this blog post is a follow up on one of the initial blog post on this new CrmBuzz URL, the original post was &lt;a href="http://blog.crmbuzz.net/articles/Testing-Article.aspx"&gt;How to Detach an Email from a Queue? Summary...&lt;/a&gt;, so finally after some replies and follow up e-mails and questions I got the time to put in the details for one of most requested line:&lt;/p&gt;  &lt;p&gt;returnStatus = emailDetach.EmailDetachFromQueue(EmailID, SourceQueueId);&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The code snipped:  &lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; EmailDetachFromQueue(Guid EmailID, Guid SourceQueueID)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; returnvalue = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         DetachFromQueueEmailRequest detachEmail = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DetachFromQueueEmailRequest();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         detachEmail.EmailId = EmailID;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;         detachEmail.QueueId = SourceQueueID;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         DetachFromQueueEmailResponse detachedEmailResponse = (DetachFromQueueEmailResponse)service.Execute(detachEmail);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;         returnvalue = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (System.Exception e)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;         returnvalue = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; returnvalue;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The E-mail detach process will not give you too much information on the validity on the completion and you probably will need to validate making another call, so these are some of the steps for the e-mail to case (incident)&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Validate E-mail content is not Spam or Duplicate&lt;/li&gt;

  &lt;li&gt;Create new Contact with E-mail address information&lt;/li&gt;

  &lt;ol&gt;
    &lt;li&gt;Create new Account with E-mail address information &lt;/li&gt;

    &lt;li&gt;Relate new Account with new Contact&lt;/li&gt;
  &lt;/ol&gt;

  &lt;li&gt;Validate that E-mail is not relation to any Case (Incident)&lt;/li&gt;

  &lt;li&gt;Create new Case (Incident) with E-mail information&lt;/li&gt;

  &lt;li&gt;Detach E-mail from the Queue (Private or Public Queue)&lt;/li&gt;

  &lt;li&gt;Assign the new Case (Incident) to the User Private Queue (Incident Owner)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;So these are the most common steps for converting an E-mail to a Case, I will be working on a similar process for Spam e-mails on MS Dynamics CRM 4.0 but in this version I will be using the Workflow's capabilities, stay tuned for more details on the new workflow E-mail to Case process.&lt;/p&gt;

&lt;p&gt;Check the Articles soon you would find information related to SDK connectivity with CRM 4.0 On Premises and Online versions&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Abe Saldaña&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.crmbuzz.net"&gt;CrmBuzz.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This all is undocumented and unsupported. Therefore you should only try these kinds of modifications if you feel comfortable working with this. 
  &lt;br /&gt;Everything here, though, is my personal opinion and is not read nor approved before being posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/25.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2008/06/12/How-tos---How-to-Detach-an-E-mail-from-a.aspx</guid>
            <pubDate>Thu, 12 Jun 2008 21:50:18 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/25.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2008/06/12/How-tos---How-to-Detach-an-E-mail-from-a.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/25.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/25.aspx</trackback:ping>
        </item>
        <item>
            <title>How to's - Getting your Lead Status and State</title>
            <link>http://blog.crmbuzz.net/archive/2008/06/11/How-tos---Getting-your-Lead-Status-and-State.aspx</link>
            <description>&lt;p&gt;Working on the previous blog post I have to get some information on the Lead's status and state, just to validate that the lead was not already qualified or disqualified and then make the conversion to an Account and to a Contact, so I started to create a SDK generic library type of assembly with the most common things I will be using on a daily basis.&lt;/p&gt;
&lt;p&gt;Working on a lead the first thing I will be doing is check if the lead remains Open [Status = 1 and State = 0 ] or that is not Qualified [ Status = 3  and State = 1 ] and if the lead is not Disqualified [Status = 4 (Most Common - Lost) and State = 2], here is some code to get the independent values:&lt;/p&gt;
&lt;div&gt;Getting the &lt;strong&gt;Lead Status&lt;/strong&gt; Information:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   1:&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; getStatus(Guid leadID)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; returnValue;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   4:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   7:&lt;/span&gt;         lead leadInformation = (lead)service.Retrieve(EntityName.lead.ToString(), leadID, &lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; AllColumns());&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   9:&lt;/span&gt;         returnValue = leadInformation.statuscode.Value;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  10:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  11:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  12:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt;( Exception)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  14:&lt;/span&gt;         returnValue = -1;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  16:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  17:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt; returnValue;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  18:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Getting the &lt;strong&gt;Lead State&lt;/strong&gt; Information:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   1:&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; getState(Guid leadID)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; returnValue;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   4:&lt;/span&gt;     &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   7:&lt;/span&gt;         lead leadInformation = (lead)service.Retrieve(EntityName.lead.ToString(), leadID, &lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; AllColumns());&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   9:&lt;/span&gt;         returnValue = ((&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;)leadInformation.statecode.Value);&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  10:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  11:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  12:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt; (Exception)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  14:&lt;/span&gt;         returnValue = -1;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  16:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt; returnValue;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  17:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note: the Lead State value is returned un-boxing the object value from the enum CRMSDK.LeadState&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Well that is good to pull the value from the lead, but as part of the conversion process I needed to change the status from Open to Qualified, so I needed to have the Update Method and handle the validation for the update, the lead status is handle not from the Service.Update but the state is managed by the SetStateLeadRequest object, here is the code for updating the Status&lt;/p&gt;
&lt;div&gt;
&lt;div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   1:&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt; UpdateStatus(Guid leadID, &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; Stateparam, &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; Statusparam)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt; returnValue = &lt;span style="COLOR: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   4:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   7:&lt;/span&gt;         SetStateLeadRequest leadUpdateRequest = &lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; SetStateLeadRequest(); &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;   9:&lt;/span&gt;         leadUpdateRequest.EntityId = leadID ;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  10:&lt;/span&gt;         &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  11:&lt;/span&gt;         leadUpdateRequest.LeadStatus = Statusparam;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  12:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  13:&lt;/span&gt;         LeadState valueState = (LeadState)Enum.ToObject(&lt;span style="COLOR: #0000ff"&gt;typeof&lt;/span&gt;(LeadState),Stateparam);&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  14:&lt;/span&gt;         leadUpdateRequest.LeadState = valueState;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  15:&lt;/span&gt;         &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  16:&lt;/span&gt;         SetStateLeadResponse stateSet = (SetStateLeadResponse)service.Execute(leadUpdateRequest);&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  17:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  18:&lt;/span&gt;         &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; resultStateCode = getState(leadID);&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  19:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  20:&lt;/span&gt;         &lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt; (resultStateCode == Stateparam)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  21:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  22:&lt;/span&gt;             returnValue = &lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  23:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  24:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  25:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  26:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt;(Exception)&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  27:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  28:&lt;/span&gt;         returnValue = &lt;span style="COLOR: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  29:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  30:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  31:&lt;/span&gt;     &lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt; returnValue;&lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  32:&lt;/span&gt;  &lt;/pre&gt;
&lt;pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"&gt;&lt;span style="COLOR: #606060"&gt;  33:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;After all this the conversion code was so simple to put together and easy to read, I hope the following code snipped's will work for you, keep in mind that I just put the core of the code, CRM connection objects and class definition are not included you need to create those and then test the code  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Abe Saldaña &lt;/p&gt;
&lt;p&gt;&lt;a href="http://crmbuzz.net"&gt;http://crmbuzz.net&lt;/a&gt;  &lt;br /&gt;
Everything here, though, is my personal opinion and is not read nor approved before being posted.&lt;/p&gt;
&lt;p&gt;No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/24.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2008/06/11/How-tos---Getting-your-Lead-Status-and-State.aspx</guid>
            <pubDate>Wed, 11 Jun 2008 23:07:06 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/24.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2008/06/11/How-tos---Getting-your-Lead-Status-and-State.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/24.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/24.aspx</trackback:ping>
        </item>
        <item>
            <title>Converting a Lead to Contact and Account</title>
            <link>http://blog.crmbuzz.net/archive/2008/05/28/Converting-a-Lead-to-Contact-and-Account.aspx</link>
            <description>&lt;div class="csharpcode"&gt;Working on a special project, I have to recreate the Lead conversion and make some other customizations on the Accounts and Contact relationship, the first code I was looking was the conversion using the Relationship mapping, I found some code regarding the related request/response, but looking under the SDK documentation finally find some code hints that I can use for the conversion.&lt;/div&gt;  &lt;p&gt;The following is the code for converting a source entity to a target entity, taking in consideration the relationship mapping using the TargetRelatedRequest and response classes (CRM 3.0 SDK)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;///  Convert to Contact, Convert/Create first the Contact then the Account&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Guid ConvertLead2Contact(Guid leadIdvalue)&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;InitializeFromRequest requestObject = &lt;span class="kwrd"&gt;new&lt;/span&gt; InitializeFromRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;requestObject.EntityMoniker = &lt;span class="kwrd"&gt;new&lt;/span&gt; Moniker();&lt;/pre&gt;

  &lt;pre class="alt"&gt;requestObject.EntityMoniker.Id = leadIdvalue;&lt;/pre&gt;

  &lt;pre&gt;requestObject.EntityMoniker.Name = EntityName.lead.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;requestObject.TargetEntityName = EntityName.contact.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt;requestObject.TargetFieldType = TargetFieldType.All;&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;InitializeFromResponse responseObject = (InitializeFromResponse)service.Execute(requestObject);&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;contact returnContact = (contact) responseObject.Entity;&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;// You need to create the new created Contact Entity&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    Guid returnContactId = service.Create(returnContact.Entity);&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt; returnContactId;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;/// Convert Lead to Account, Convert the Account after the Contact.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Guid ConvertLead2Account(Guid leadIdvalue, Guid primaryContactId)&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;InitializeFromRequest requestObject = &lt;span class="kwrd"&gt;new&lt;/span&gt; InitializeFromRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;      requestObject.EntityMoniker = &lt;span class="kwrd"&gt;new&lt;/span&gt; Moniker();&lt;/pre&gt;

  &lt;pre class="alt"&gt;      requestObject.EntityMoniker.Id = leadIdvalue;&lt;/pre&gt;

  &lt;pre&gt;      requestObject.EntityMoniker.Name = EntityName.lead.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;      requestObject.TargetEntityName = EntityName.account.ToString();&lt;/pre&gt;

  &lt;pre class="alt"&gt;      requestObject.TargetFieldType = TargetFieldType.All;&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;InitializeFromResponse responseObject = &lt;/pre&gt;

  &lt;pre&gt;    (InitializeFromResponse)service.Execute(requestObject);&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;      account returnAccount = (account) responseObject.Entity;&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(primaryContactId != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    If(primaryContactId != Guid.Empty)&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;// relationship with the Contact&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;returnAccount.primarycontactid = &lt;/pre&gt;

  &lt;pre class="alt"&gt;CrmTypes.CreateLookup(EntityName.contact.ToString(),primaryContactId);&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;// You need to create the new converted Account&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    Guid returnAccountId = service.Create(returnAccount.Entity);&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;return&lt;/span&gt; returnAccountId;&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%"&gt;Notes: &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%"&gt;I assume you already created or added the CRM Web Service reference and created the CrmService object (service) in your project. Also I'm using the CrmTypes class to help create CRM type objects &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%"&gt;The Lead status is not change using the TargetRelatedRequest I will post another article where is going to guide you and have code snippets to check the value, Qualify, Disqualify and Reactivate the Lead. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%"&gt;Hope this article will help. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 9pt"&gt;Abraham Saldaña &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 9pt"&gt;&lt;a href="http://crmbuzz.net"&gt;http://crmbuzz.net&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/21.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2008/05/28/Converting-a-Lead-to-Contact-and-Account.aspx</guid>
            <pubDate>Wed, 28 May 2008 09:36:57 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/21.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2008/05/28/Converting-a-Lead-to-Contact-and-Account.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/21.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/21.aspx</trackback:ping>
        </item>
        <item>
            <title>Microsoft Dynamics CRM 4.0 Training Documentation</title>
            <link>http://blog.crmbuzz.net/archive/2008/02/21/Microsoft-Dynamics-CRM-4.0-Training-Documentation.aspx</link>
            <description>&lt;p&gt;Partners enrolled in a Partner Service Plan for Microsoft Dynamics™ now have unlimited organizational access to online training for Microsoft Dynamics and related business products. &lt;/p&gt;  &lt;p&gt;If you are not enrolled in a Partner Service Plan, learn more at Partner Source &amp;gt; Services &amp;amp; Service Plans &amp;gt; Partner Service Plans to choose the plan that is right for your organization! &lt;/p&gt;  &lt;p&gt;Training Document Links:   &lt;br /&gt;&lt;a href="https://mbs.microsoft.com/partnersource/communities/training/trainingmaterials/student/course8911.htm?printpage=false" target="_blank"&gt;Installation and Deployment in Microsoft Dynamics CRM 4.0 Course number 8911*&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://mbs.microsoft.com/partnersource/communities/training/trainingmaterials/student/course8912.htm?printpage=false" target="_blank"&gt;Customization and Configuration in Microsoft Dynamics CRM 4.0 Course Number 8912*&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://mbs.microsoft.com/partnersource/communities/training/trainingmaterials/student/course8913.htm?printpage=false" target="_blank"&gt;Applications in Microsoft Dynamics CRM 4.0 Course Number 8913*&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Microsoft Dynamics CRM Team Blog    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/crm/archive/2008/01/28/crm-4-0-training-resources.aspx"&gt;http://blogs.msdn.com/crm/archive/2008/01/28/crm-4-0-training-resources.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/20.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2008/02/21/Microsoft-Dynamics-CRM-4.0-Training-Documentation.aspx</guid>
            <pubDate>Thu, 21 Feb 2008 18:46:07 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/20.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2008/02/21/Microsoft-Dynamics-CRM-4.0-Training-Documentation.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/20.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/20.aspx</trackback:ping>
        </item>
        <item>
            <title>Free Software for Students - Microsoft DreamSpark</title>
            <link>http://blog.crmbuzz.net/archive/2008/02/21/Free-Software-for-Students---Microsoft-DreamSpark.aspx</link>
            <description>&lt;p&gt;How would you like a free copy of &lt;a href="http://msdn2.microsoft.com/en-us/vs2008/products/default.aspx"&gt;Microsoft Visual Studio 2008&lt;/a&gt;? How about the entire &lt;a href="http://www.microsoft.com/expression/default.aspx"&gt;Microsoft Expression Studio&lt;/a&gt;? Not enough...... how about &lt;a href="http://www.microsoft.com/windowsserver2003/default.mspx"&gt;Microsoft Windows Server 2003&lt;/a&gt; and more? &lt;/p&gt;  &lt;p&gt;Today, Microsoft announced an unprecedented software program that we believe will help change the lives of millions of students around the world. The program, Microsoft DreamSpark, is focused on providing millions of college and high school students with no-cost access to the latest Microsoft developer (i.e., versions of Visual Studio, XNA Game Studio), designer tools (Expression Studio) and Microsoft platform resources (i.e., versions of Windows Server and SQL Server).&lt;/p&gt;  &lt;p&gt;Currently, the program is accessible by college students in 11 countries including: Belgium, Canada, China, Finland, France, Germany, Spain, Sweden, Switzerland, the United Kingdom and the United States.  In the coming months, the Microsoft DreamSpark team will expand the program’s reach to include high school students and to increase the number of participating countries.&lt;/p&gt;  &lt;p&gt;Please visit &lt;a href="http://channel8.msdn.com/"&gt;Channel 8&lt;/a&gt;, &lt;a href="https://downloads.channel8.msdn.com/"&gt;https://downloads.channel8.msdn.com/&lt;/a&gt; to learn more about Microsoft DreamSpark. &lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/19.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2008/02/21/Free-Software-for-Students---Microsoft-DreamSpark.aspx</guid>
            <pubDate>Thu, 21 Feb 2008 18:36:22 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/19.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2008/02/21/Free-Software-for-Students---Microsoft-DreamSpark.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/19.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/19.aspx</trackback:ping>
        </item>
    </channel>
</rss>