<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>Unsupported</title>
        <link>http://blog.crmbuzz.net/category/20.aspx</link>
        <description>Unsupported Code</description>
        <language>en-US</language>
        <copyright>Abe Saldana</copyright>
        <managingEditor>abraham@CRMBuzz.net</managingEditor>
        <generator>Subtext Version 1.9.4.78</generator>
        <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>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>Email Templates tag merging</title>
            <link>http://blog.crmbuzz.net/archive/2007/07/26/Email-Templates-tag-merging.aspx</link>
            <description>&lt;p&gt;I was working on a small project making some changes to the Email Templates when I got the requirements to create some meta tags and implement detail logic that will depend on the value of a field, that was interesting and challenging at the same time and  make that customization been supported by the infrastructure of CRM, well I made changes but these are unsupported code, these are the steps on how to make the customizations:&lt;/p&gt; &lt;p&gt;1) Make the modifications to ...\Activities\email\edit.aspx file. &lt;/p&gt; &lt;p&gt;2) Update the javascript function ApplyTemplate() and include the functionality required for the customer.&lt;/p&gt; &lt;div style="border-right: windowtext 1pt solid; padding-right: 4pt; border-top: windowtext 1pt solid; padding-left: 4pt; background: #d9d9d9; padding-bottom: 1pt; border-left: windowtext 1pt solid; padding-top: 1pt; border-bottom: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217"&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;function ApplyTemplate()&lt;?xml:namespace prefix = o /?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormalCxSpMiddle" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-add-space: auto; mso-pagination: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;{&lt;/span&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;var oTarget = ChooseTemplateTarget();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;if (oTarget == null)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;return;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;var sUrl = "/_grid/cmds/dlg_bulkemail.aspx?bulkemail=false" + "&amp;amp;objectTypeCode=" + oTarget.otype + "&amp;amp;objectId=" + oTarget.oid;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;var sResponse = openStdDlg(sUrl, null, 550, 850);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;if (sResponse != null)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;// Get Response from the email template&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;var templatedescription = sResponse.EmailBody ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;// Get the contact/account id for searching&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;var ToRecipients = crmForm.all.to.Items();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;var customerid = ToRecipients[0].id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;// Get status for the contact/account &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;&lt;font color="#008000"&gt;var validationonBoolean = GetWebServiceValidation(customerid);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;if (validationonBoolean)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;// Customer Validation is TRUE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;templatedescription = stringReplace(templatedescription&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;font color="#000000"&gt;,"[LOCALEDMESSAGE]","Replace message with English version");&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;}else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;// Customer Validation is FALSE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;templatedescription = stringReplace(templatedescription&lt;/font&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;font color="#000000"&gt;,"[LOCALEDMESSAGE]","Replace message with Spanish version");&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;font color="#008000"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;crmForm.all.description.InsertValue ( templatedescription );&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;3) After that I used the normal string.Replace function finding the function only replaced the first instance, that will take me to the second correction and make the following function:&lt;/p&gt; &lt;div style="border-right: windowtext 1pt solid; padding-right: 4pt; border-top: windowtext 1pt solid; padding-left: 4pt; background: #d9d9d9; padding-bottom: 1pt; border-left: windowtext 1pt solid; padding-top: 1pt; border-bottom: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217"&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;function stringReplace(originalString, findText, replaceText)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;var pos = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;var len = findText.length;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;pos = originalString.indexOf(findText);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;while (pos != -1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 15pt; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 0.5in; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;preString = originalString.substring(0,pos);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 0.5in; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;postString = originalString.substring(pos + len,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 0.5in; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;originalString.length);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 0.5in; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;originalString = preString + replaceText + postString;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 0.5in; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;pos = originalString.indexOf(findText);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; text-indent: 0.5in; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;return originalString;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #d9d9d9; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: #984806; font-family: 'Century Gothic','sans-serif'; mso-themecolor: accent6; mso-themeshade: 128; mso-bidi-font-family: 'Courier New'"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;The rest was a simple implementation of your Web Services call, please read the previous blog called "&lt;a href="http://blog.crmbuzz.net/archive/2007/05/18/How-to-call-my-web-service-using-Javascript.aspx"&gt;How to call my web service using Javascript?&lt;/a&gt;"&lt;/p&gt; &lt;p&gt;Remember that this is an Unsupported customization and when a service patch come it will provably remove those customizations.&lt;/p&gt; &lt;p&gt;I hope this information help you to add more flexibility to the email templates.&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; mso-bidi-font-family: arial; mso-fareast-font-family: 'Times New Roman'"&gt;Abe Saldaña &lt;/span&gt;&lt;span style="font-size: 12pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 9pt; mso-bidi-font-family: arial; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;a href="http://www.crmbuzz.net"&gt;http://www.crmbuzz.net&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 9pt; mso-bidi-font-family: arial; mso-fareast-font-family: 'Times New Roman'"&gt;This all is undocumented and unsupported. Therefore you should only try these kinds of modifications if you feel comfortable 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;/span&gt;&lt;span style="font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 9pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blog.crmbuzz.net/aggbug/10.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Abe Saldana</dc:creator>
            <guid>http://blog.crmbuzz.net/archive/2007/07/26/Email-Templates-tag-merging.aspx</guid>
            <pubDate>Fri, 27 Jul 2007 02:31:31 GMT</pubDate>
            <wfw:comment>http://blog.crmbuzz.net/comments/10.aspx</wfw:comment>
            <comments>http://blog.crmbuzz.net/archive/2007/07/26/Email-Templates-tag-merging.aspx#feedback</comments>
            <wfw:commentRss>http://blog.crmbuzz.net/comments/commentRss/10.aspx</wfw:commentRss>
            <trackback:ping>http://blog.crmbuzz.net/services/trackbacks/10.aspx</trackback:ping>
        </item>
    </channel>
</rss>