<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MSCRM Blogger &#187; contact</title>
	<atom:link href="http://mscrmblogger.com/tag/contact/feed/" rel="self" type="application/rss+xml" />
	<link>http://mscrmblogger.com</link>
	<description>Achieving it all with Microsoft Dynamics CRM™</description>
	<lastBuildDate>Thu, 10 May 2012 20:24:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>InfoPath to CRM: Accepting Emailed InfoPath Forms</title>
		<link>http://mscrmblogger.com/2011/11/21/infopath-to-crm-accepting-emailed-infopath-forms/</link>
		<comments>http://mscrmblogger.com/2011/11/21/infopath-to-crm-accepting-emailed-infopath-forms/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 19:05:51 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[API-SDK]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 2011]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[microsoft dynamics crm]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 2011]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Web Resource]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=889</guid>
		<description><![CDATA[Everybody loves to use InfoPath forms.  And let's face it, we all wish we could just take them and put them into CRM.  This post delves into how I integrated InfoPath &#38; CRM to dynamically allow InfoPath forms received by email into CRM records.  It is still <i>under development</i>, but the source code has been partially tested and works.]]></description>
			<content:encoded><![CDATA[<p>Everybody loves to use InfoPath forms.  And let&#8217;s face it, we all wish we could just take them and put them into CRM.  What I&#8217;ve written is a simple way to do that without the hassle of figuring out how to bind the InfoPath form schema to a custom WCF service.  It still doesn&#8217;t do everything I want it to, but it works, so I figured I&#8217;d go ahead and put it out there for everyone to look at, play with, and even use.</p>
<p>If you are interested in this solution, you can download the following:</p>
<ul>
<li><a href='http://mscrmblogger.com/wp-content/uploads/2011/11/InfoPath_1_0_0_0_managed.zip'>Managed Solution</a> (this is the only thing you need)</li>
<li><a href='http://mscrmblogger.com/wp-content/uploads/2011/11/InfoPath_1_0_0_0.zip'>Unmanaged Solution</a> (in case you want to modify mine, like add grid support, it is on my to-do list)</li>
<li><a href='http://mscrmblogger.com/wp-content/uploads/2011/11/InfoPath4CRMSourceCode.zip'>Source Code</a> (this is in case you would prefer to use a WCF service or if you just want to play around with my code)</li>
</ul>
<p>Once you&#8217;ve installed the managed solution, you&#8217;ll need to do the following to create / setup an InfoPath form:</p>
<ol>
<li>
<p>For this particular InfoPath integration, you need to create InfoPath Forms that mirror a CRM Entity.<br />
<strong>Note: </strong><em>You can always create a new entity for the form data.</em></p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC13.png" alt=""/></p>
</li>
<li>
<p>Rename the default form Group to the name of the entity (ex: Contact)</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC23.png" alt=""/></p>
</li>
<li>
<p>Inside CRM create the InfoPath form (it is an entity included in the solution), select the entity and save the form.
</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC31.png" alt=""/></p>
</li>
<li>
<p>Once it has been saved, you can copy the ID using the &#8220;Copy ID&#8221; link in the header.<br />
<br /><strong>Note: </strong>If you do not select the <em>Allow Any CRM Field </em>checkbox, you will need to add the individual Fields, which can be found in the left navigation.</p>
</li>
<li>
<p>In the InfoPath Form Designer, add a field named SubmissionCode with the Default Value as the ID you just copied.<br />
<br /><b>Note:</b> Using the submission code allows us to check and see if the form is valid, active, and allowed.</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/submissioncode.png" alt=""/></p>
</li>
<li>
<p>Add a field for each of the fields in CRM that you want to be available, selecting the appropriate data type.<br />
<br /><b>Note:</b> Unfortunately I have not had the time to test the fields and have been using the checkbox on the infopath form record to enable any/all CRM fields.  However, I did not want to delay releasing the code and information as it currently is.  If someone identifies a problem with this or any other section of the code, I&#8217;ll be happy to look into it and work on resolving the issue.</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC53.png" alt=""/></p>
</li>
<li>
<p>Layout the fields on the form, then click File &gt; Submit Options &gt; To Email</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC63.png" alt=""/></p>
</li>
<li>
<p>Enter the Queue email or where you want new forms to be submitted.</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC73.png" alt=""/></p>
</li>
<li>
<p>Click Next.</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC83.png" alt=""/></p>
</li>
<li>
<p>Click Finish.</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC93.png" alt=""/></p>
</li>
<li>Save and close the form designer.</li>
<li>
<p>Open the form and test submission.</p>
<p style="text-align: center"><img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC103.png" alt=""/></p>
</li>
</ol>
<p>Once the email comes into CRM, the process of reading the form is easy; you just open it up and click the <img src="http://mscrmblogger.com/wp-content/uploads/2011/11/112111_1905_InfoPathtoC113.png" alt=""/> Import InfoPath button on the ribbon.</p>
<p>Usually I would post the source-code and comment on how it works in great detail, but this time, it really depends on which component.  There is a plugin and WCF service written in C# as well as two Jscript files, one for the buttons and one for the InfoPath form inside CRM that creates a drop-down of the entities in CRM.  I would suggest downloading the unmanaged solution and source-code if you want to delve into those items.</p>
<p>Now, for complex situations or form conversions, binding the InfoPath schema is the way to go.  Using that method (the one described in detail on <a href="http://blogs.msdn.com/b/philoj/archive/2005/11/08/490200.aspx">Philo&#8217;s Weblog</a>) you can import the InfoPath form schema into Visual Studio:</p>
<ol>
<li>Create an InfoPath form and lay it out the way you want it.
</li>
<li>Extract the form files (File | Extract Form Files) to a location you can find later.
</li>
<li>Close the InfoPath form designer.
</li>
<li>Open the Visual Studio command prompt.
</li>
<li>Change to the directory where you extracted the files<br /><strong>cd c:\myinfopathfiles<br />
</strong></li>
<li>Run xsd against the myschema.xsd in that directory, and specify the namespace you would like to use.<br /><strong>Note: </strong>My WCF namespace is CrmInfoPathService and my plugin namespace is InfoPathPlugin.<br /><strong>xsd.exe myschema.xsd /classes /l:cs /n:InfoPathPlugin<br />
</strong></li>
<li>Then you can deserialize the xml into the object and store it in CRM or any other system using the logic embedded in your code.</li>
</ol>
<p>The key point to my solution was not to do something that everyone does on occasion, but to make something so that I can leverage it in the future and not have to create a new integration every time I wanted to leverage a new form.  Now, on that note, here are the list of things that if you delve into, I&#8217;d like to know, a.k.a. my to-do list for this project:
</p>
<ul>
<li>Add a button onto the grid for activities</li>
<li>Create a way to handle child entities.</li>
<li>Modify the plugin/WCF code to link the created entities to the form email using connections.</li>
<li>Change the button on the form to monitor for the results (success/failure) and report back to the user.</li>
<li><i>Any great ideas my readers think should be added!</i></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2011/11/21/infopath-to-crm-accepting-emailed-infopath-forms/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adding ImageTools to the CRM Attachment Image for CRM 2011</title>
		<link>http://mscrmblogger.com/2011/09/15/adding-imagetools-to-the-crm-attachment-image-for-crm-2011/</link>
		<comments>http://mscrmblogger.com/2011/09/15/adding-imagetools-to-the-crm-attachment-image-for-crm-2011/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 16:31:40 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[API-SDK]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[CodePlex]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 2011]]></category>
		<category><![CDATA[CRM Online]]></category>
		<category><![CDATA[crm sdk]]></category>
		<category><![CDATA[crm2011]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[ImageTools]]></category>
		<category><![CDATA[Microsoft Dynamics]]></category>
		<category><![CDATA[microsoft dynamics crm]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 2011]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[Web Resource]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=735</guid>
		<description><![CDATA[<p>An update to the Silverlight control on codeplex at <a href="http://crmattachmentimage.codeplex.com">CRMAttachmentImage.CodePlex.com</a> for adding images to any entity form in CRM 2011 to now support GIFs and WebCam capture using ImageTools for Silverlight.</p>]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://mscrmblogger.com/2011/05/10/crm-attachment-image-for-crm-2011-entities/">previous post</a> I wrote about a control I posted to <a href="http://crmattachmentimage.codeplex.com" target="_blank">codeplex</a> that I used in my demos, a <a href="http://crmattachmentimage.codeplex.com" target="_blank">CRM Attachment Image Control</a>.</p>
<p>It stored the images in the notes (still does &#8211; and currently does not have an option for storing elsewhere&#8230;).  I still have not figured out how to put buttons on the ribbon that can fire the upload control, etc.  Although, I recently found out that Marco Amoedo (blog: <a href="http://marcoamoedo.com">marcoamoedo.com</a>, twitter: <a target="_blank" href="http://twitter.com/#!/marcoamoedo" target="_blank">marcoamoedo</a>) had leveraged the <a href="http://imagetools.codeplex.com" target="_blank">ImageTools for Silverlight</a> to add WebCam support and I was already starting to play with it to add Gif support.  I was able to work with him to get his modifications and add gif support.   Now you have even more useful features that you can enable with a simple configuration change and a new silverlight web-resource.</p>
<p><a href="http://mscrmblogger.com/wp-content/uploads/2011/09/Contact-Photo-WebCam.png"><img src="http://mscrmblogger.com/wp-content/uploads/2011/09/Contact-Photo-WebCam.png" alt="" title="Contact Photo WebCam" width="509" height="383" class="aligncenter size-full wp-image-745" /></a></p>
<p>Now, if you look in the bottom right, there is a webcam button next to the upload button that allows you to take a picture instead of uploading one.  When you try and take the picture you will receive the following request for access.</p>
<p><a href="http://mscrmblogger.com/wp-content/uploads/2011/09/Silverlight-Camera-Access.png"><img src="http://mscrmblogger.com/wp-content/uploads/2011/09/Silverlight-Camera-Access.png" alt="" title="Silverlight Camera Access" width="564" height="217" class="aligncenter size-full wp-image-747" /></a></p>
<p>So you may be asking: what is <a href="http://imagetools.codeplex.com" target="_blank">ImageTools for Silverlight</a>? where did it come from?, and why are you using it?  The answers are simple. According to the codeplex page for the <a href="http://imagetools.codeplex.com" target="_blank">ImageTools for Silverlight</a>, it is &quot;a library, which provides additional functionality for loading, saving and [manipulating] images from different sources and with different formats.&#038;quot  The reason to use it is simple, it is open-source, and it&#8217;s license allows me to use it (it is realeased under Ms-PL &#8211; the same license as my control on codeplex).</p>
<p>If you already use the <a href="http://crmattachmentimage.codeplex.com" target="_blank">CRM Attachment Image</a>, you can just overwrite your xap file with the one from <a href="http://crmattachmentimage.codeplex.com" target="_blank">codeplex</a>, but you will still need to edit the properties of the web-resource on your form to include <b>|webcam=true</b>.  The new example syntax is:</p>
<pre>field=new_imageattachmentid|subject='Contact''s Image'|prefix='img-'|webcam=true</pre>
<p>So a special thanks to <a href="http://marcoamoedo.com">Marco</a> for his help, this is a great change that I think a lot of people will be able to use.</p>
<p>If you need assistance in setting up the image control, I have it documented on codeplex, but here is a simple set of directions that work at the time of this article bieng posted:</p>
<ol>
<li>Create a solution</li>
<li>Upload the xap as a web-resource</li>
<li>Add your entity to the solution, and create a new text field on the entity that is 50 characters long, not searchable, preferably called something like attachmentid or savedattachmentid &#8211; it will be used to store the annotationid or the note that stores the attached image.</li>
<li>Add the field to the form and make it not visible.</li>
<li>Add the Web-Resource to the form
<ul>
<li>Check the checkbox to pass the id and type, etc.</li>
<li>In the parameters add the fields and their values seperated by a pipe |</li>
</ul>
</li>
<li>Save and publish the form.</li>
<li>Test it!</li>
</ol>
<p>The example config for the web-resource is before the instructions, and are very useful because you can just copy them and change the field <b>new_imageattachmentid</b> to your field name and it should work.  There are a number of fields available to you if you want to change how the control functions, they are documented on codeplex, and they are:</p>
<ul>
<li>field &#8211; The name of the field you are using to store the annotationid of the attachment. It is required, and the field MUST BE ON THE FORM (it does not need to be visible). </li>
<li>subject &#8211; The subject for attachments &#8211; the following substitutions are available (%s will be replaced with the name of the file )</li>
<li>prefix &#8211; The prefix for all attachment images (this is used to filter the results, etc)</li>
<li>hidebuttons &#8211; Used to hide the buttons that are in the silverlight control so that you can use the ribbon to control the application</li>
<li>savefirst &#8211; Used to set the message that is displayed on a form that is in Create Mode</li>
<li>webcam &#8211; Set to true if you want to enable the webcam it is not currently tide to hidebuttons</li>
</ul>
<hr />
<p style="color:#c69"><i>I added the following parameters at Bill&#8217;s request (Thanks Bill):</i></p>
<ul style="color:#f9f">
<li><b>max-width</b>: maximum width for all images</li>
<li><b>max-height</b>: maximum height for all images</li>
<li><b>max-webcam-width</b>: maximum webcam image width, overrides max-width for web-cam images</li>
<li><b>max-webcam-height</b>: maximum webcam image height, overrides max-height for web-cam images</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2011/09/15/adding-imagetools-to-the-crm-attachment-image-for-crm-2011/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>CRM Attachment Image for CRM 2011 Entities</title>
		<link>http://mscrmblogger.com/2011/05/10/crm-attachment-image-for-crm-2011-entities/</link>
		<comments>http://mscrmblogger.com/2011/05/10/crm-attachment-image-for-crm-2011-entities/#comments</comments>
		<pubDate>Tue, 10 May 2011 15:34:35 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[CodePlex]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 2011]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 2011]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[Web Resource]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=440</guid>
		<description><![CDATA[<p>In a previous post I provided a screenshot with a contact photo on the form.  I have now released a version of the Silverlight control on codeplex at <a href="http://crmattachmentimage.codeplex.com">CRMAttachmentImage.CodePlex.com</a>.  It is a Silverlight control for adding images to any entity form in CRM 2011.</p>]]></description>
			<content:encoded><![CDATA[<p><i>The CRMAttachmentImage control downloads on codeplex have been updated to include gif and webcam support that I talk about in a <a href="http://mscrmblogger.com/2011/09/15/adding-imagetools-to-the-crm-attachment-image-for-crm-2011/">new article</a> that includes some instructions that may be helpful.</i></p>
<p>A while back Christian asked about this image control I had in a screenshot on one of my posts.  And while it was ok, it was far from being something I would throw into a production environment.  It was a starting point.  I am proud to say that I have put the Silverlight control on codeplex at <a href="http://crmattachmentimage.codeplex.com">CRMAttachmentImage.CodePlex.com</a>.  It is in beta because I am still working on putting the buttons on the ribbon instead of in the control.</p>
<p><a href="http://mscrmblogger.com/wp-content/uploads/2011/03/ContactForm.png"><img src="http://mscrmblogger.com/wp-content/uploads/2011/03/ContactForm.png" alt="Contact Form - with Attachment Image Silverlight Control" title="Contact Form with CRM Attachment Image Silverlight Control" width="897" height="647" class="aligncenter size-full wp-image-365" /></a></p>
<p><i>** If anyone has any ideas for loading a file in JavaScript and sending it to the Silverlight control to load the data, I&#8217;m open to suggestions.</i></p>
<p>The image itself is stored as an attachment in the notes.  This way the control is utilizing CRM and not an external system to handle the images.  Simply put in order to use this your users will need to be able to read notes and create them.  They will also need the &quot;Customization &gt; ISV Extensions&quot; permission.  If you are not seeing the images, and everything else is right, then try checking the permissions.</p>
<p>Instructions are posted on the codeplex site, but it is fairly straight forward to add to a form.  First, you just upload the web-resource and create a text field to store the guid for the not (annotationid).  It <b>MUST BE ON THE FORM</b>, but it does not need to be visible, and you probably don&#8217;t want to make it searchable.  The web resource does require the id and type to be passed, and some additional parameters.</p>
<p>The parameters are separated by a pipe | instead of a comma.  An example parameter is:</p>
<pre>field=new_imageattachmentid|subject='Contact''s Image'|prefix='img-'</pre>
<p>Check out the full parameter list at <a href="http://crmattachmentimage.codeplex.com">CRMAttachmentImage.CodePlex.com</a>.  If you have any suggestions or comments, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2011/05/10/crm-attachment-image-for-crm-2011-entities/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>CRM 2011: Change CRM Address State to a drop-down</title>
		<link>http://mscrmblogger.com/2011/03/07/crm-2011-change-crm-address-state-to-a-drop-down/</link>
		<comments>http://mscrmblogger.com/2011/03/07/crm-2011-change-crm-address-state-to-a-drop-down/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 15:01:33 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm 2011]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 2011]]></category>
		<category><![CDATA[onload event]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=338</guid>
		<description><![CDATA[<p><b>Do you want a drop down box for the state, but you don't want to break core CRM functionality?</b></p>
<p>In CRM 4.0 I had posted an article about <a href="http://mscrmblogger.com/2009/05/11/change-crm-address-state-to-a-drop-down-box/">changing the CRM Address State to a drop down box</a>.  I have went back and updated the code a little (fixed a bug) and it will work with CRM 2011.</p>
<p>Ok, this script uses the same methods I used in CRM 4 to show the states for the United States and Canada (You can always modify it to have more options).  This will help restrict what people put in the state field by providing them a drop down box.  It will also allow them to view the old text box and enter any custom information just by clicking on '* ENTER A CUSTOM PROVINCE *'.</p>
<p>This script will work on the onload for a lead, contact, account, and sales-contact.</p>]]></description>
			<content:encoded><![CDATA[<p><b>This page is nolonger current.  Please view: <a href="http://mscrmblogger.com/2011/05/11/crm-2011-making-the-state-field-a-drop-down/">http://mscrmblogger.com/2011/05/11/crm-2011-making-the-state-field-a-drop-down/</a></b></p>
<p><b>Do you want a drop down box for the state, but you don&#8217;t want to break core CRM functionality?</b></p>
<p>In CRM 4.0 I had posted an article about <a href="http://mscrmblogger.com/2009/05/11/change-crm-address-state-to-a-drop-down-box/">changing the CRM Address State to a drop down box</a>.  I have went back and updated the code a little (fixed a bug) and it will work with CRM 2011.</p>
<p>Ok, this script uses the same methods I used in CRM 4 to show the states for the United States and Canada (You can always modify it to have more options).  This will help restrict what people put in the state field by providing them a drop down box.  It will also allow them to view the old text box and enter any custom information just by clicking on &#8216;* ENTER A CUSTOM PROVINCE *&#8217;.</p>
<p>This script will work on the onload for a lead, contact, account, and sales-contact.</p>
<p>This script does use the _d html objects, which, to my knowledge is considered unsupported in CRM 2011.  CRM 2011 does expose these data elements and control elements using Xrm.Page and this script doesn&#8217;t use them, and I may come back and update this script, but since it works in CRM 4 and in CRM 2011, I figured I&#8217;d repost it.</p>
<p><b>StateDropDown.js Jscript Code:</b></p>
<pre name="code" class="javascript">
function ddlState ()
{

    // Get the state or province cell.
    var provinceid = 'stateorprovince';
    var statecell = document.getElementById(provinceid + '_d');

    if (!statecell)
    {
        provinceid = 'address1_stateorprovince';
        statecell = document.getElementById(provinceid + '_d');
    }

    var stateobject = document.getElementById(provinceid);
    stateobject.style.display = 'none';

    var statevalue = stateobject.value;

    var ddl = document.createElement('select');
    ddl.setAttribute('id','new_stateorprovince');
    ddl.setAttribute('class','ms-crm-SelectBox');
    ddl.setAttribute('req','2');
    ddl.setAttribute('height','4');
    ddl.setAttribute('style','IME-MODE: auto');

    // Build some lists.
    var CStateName = new Array();
    var CStateAbbr = new Array();
    var USStateName = new Array();
    var USStateAbbr = new Array();

    // If nothing is entered for state, show SELECT A STATE
    var found=false;
    if (statevalue.length&lt;1)
    {
        stateoption=document.createElement('option');
        stateoption.setAttribute('value','');
        stateoption.innerHTML = ' ** SELECT A STATE ** ';
        ddl.appendChild(stateoption);
        found=true;
    }

    // Build Canada Array
    CStateName[0]  = "Alberta";                   CStateAbbr[0]  = "AB";
    CStateName[1]  = "British Columbia";          CStateAbbr[1]  = "BC";
    CStateName[2]  = "Manitoba";                  CStateAbbr[2]  = "MB";
    CStateName[3]  = "New Brunswick";             CStateAbbr[3]  = "NB";
    CStateName[4]  = "Newfoundland and Labrador"; CStateAbbr[4]  = "NL";
    CStateName[5]  = "Northwest Territories";     CStateAbbr[5]  = "NT";
    CStateName[6]  = "Nova Scotia";               CStateAbbr[6]  = "NS";
    CStateName[7]  = "Nunavut";                   CStateAbbr[7]  = "NU";
    CStateName[8]  = "Ontario";                   CStateAbbr[8]  = "ON";
    CStateName[9]  = "Prince Edward Island";      CStateAbbr[9]  = "PE";
    CStateName[10] = "Quebec";                    CStateAbbr[10] = "QC";
    CStateName[11] = "Saskatchewan";              CStateAbbr[11] = "SK";
    CStateName[12] = "Yukon";                     CStateAbbr[12] = "YT";

    // Build US Array
    USStateName[0]  = "Alabama";        USStateAbbr[0]  = "AL";
    USStateName[1]  = "Alaska";         USStateAbbr[1]  = "AK";
    USStateName[2]  = "Arizona";        USStateAbbr[2]  = "AZ";
    USStateName[3]  = "Arkansas";       USStateAbbr[3]  = "AR";
    USStateName[4]  = "California";     USStateAbbr[4]  = "CA";
    USStateName[5]  = "Colorado";       USStateAbbr[5]  = "CO";
    USStateName[6]  = "Connecticut";    USStateAbbr[6]  = "CT";
    USStateName[7]  = "District of Columbia"; USStateAbbr[7]  = "DC";
    USStateName[8]  = "Delaware";       USStateAbbr[8]  = "DE";
    USStateName[9]  = "Florida";        USStateAbbr[9]  = "FL";
    USStateName[10]  = "Georgia";       USStateAbbr[10]  = "GA";
    USStateName[11] = "Hawaii";         USStateAbbr[11] = "HI";
    USStateName[12] = "Idaho";          USStateAbbr[12] = "ID";
    USStateName[13] = "Illinois";       USStateAbbr[13] = "IL";
    USStateName[14] = "Indiana";        USStateAbbr[14] = "IN";
    USStateName[15] = "Iowa";           USStateAbbr[15] = "IA";
    USStateName[16] = "Kansas";         USStateAbbr[16] = "KS";
    USStateName[17] = "Kentucky";       USStateAbbr[17] = "KY";
    USStateName[18] = "Louisiana";      USStateAbbr[18] = "LA";
    USStateName[19] = "Maine";          USStateAbbr[19] = "ME";
    USStateName[20] = "Maryland";       USStateAbbr[20] = "MD";
    USStateName[21] = "Massachusetts";  USStateAbbr[21] = "MA";
    USStateName[22] = "Michigan";       USStateAbbr[22] = "MI";
    USStateName[23] = "Minnesota";      USStateAbbr[23] = "MN";
    USStateName[24] = "Mississippi";    USStateAbbr[24] = "MS";
    USStateName[25] = "Missouri";       USStateAbbr[25] = "MO";
    USStateName[26] = "Montana";        USStateAbbr[26] = "MT";
    USStateName[27] = "Nebraska";       USStateAbbr[27] = "NE";
    USStateName[28] = "Nevada";         USStateAbbr[28] = "NV";
    USStateName[29] = "New Hampshire";  USStateAbbr[29] = "NH";
    USStateName[30] = "New Jersey";     USStateAbbr[30] = "NJ";
    USStateName[31] = "New Mexico";     USStateAbbr[31] = "NM";
    USStateName[32] = "New York";       USStateAbbr[32] = "NY";
    USStateName[33] = "North Carolina"; USStateAbbr[33] = "NC";
    USStateName[34] = "North Dakota";   USStateAbbr[34] = "ND";
    USStateName[35] = "Ohio";           USStateAbbr[35] = "OH";
    USStateName[36] = "Oklahoma";       USStateAbbr[36] = "OK";
    USStateName[37] = "Oregon";         USStateAbbr[37] = "OR";
    USStateName[38] = "Pennsylvania";   USStateAbbr[38] = "PA";
    USStateName[39] = "Rhode Island";   USStateAbbr[39] = "RI";
    USStateName[40] = "South Carolina"; USStateAbbr[40] = "SC";
    USStateName[41] = "South Dakota";   USStateAbbr[41] = "SD";
    USStateName[42] = "Tennessee";      USStateAbbr[42] = "TN";
    USStateName[43] = "Texas";          USStateAbbr[43] = "TX";
    USStateName[44] = "Utah";           USStateAbbr[44] = "UT";
    USStateName[45] = "Vermont";        USStateAbbr[45] = "VT";
    USStateName[46] = "Virginia";       USStateAbbr[46] = "VA";
    USStateName[47] = "Washington";     USStateAbbr[47] = "WA";
    USStateName[48] = "West Virginia";  USStateAbbr[48] = "WV";
    USStateName[49] = "Wisconsin";      USStateAbbr[49] = "WI";
    USStateName[50] = "Wyoming";        USStateAbbr[50] = "WY";

    // Build the drop down
    var stateoption;
    stateoption=document.createElement('option');
    stateoption.setAttribute('value','');
    stateoption.innerHTML = '---United States--------';
    ddl.appendChild(stateoption);

    var i=0;
    for(i=0;i&lt;USStateName.length;i++)
    {
        stateoption=document.createElement('option');
        stateoption.setAttribute('value',USStateAbbr[i]);
        if (USStateAbbr[i]==statevalue)
        {
            stateoption.setAttribute('selected','selected');
            found = true;
        }
        stateoption.innerHTML = USStateAbbr[i] +
        ' (' + USStateName[i] + ')';
        ddl.appendChild(stateoption);
    }

    stateoption=document.createElement('option');
    stateoption.setAttribute('value','');
    stateoption.innerHTML = '---Canada---------------';
    ddl.appendChild(stateoption);

    var i=0;
    for(i=0;i&lt;CStateName.length;i++)
    {
        stateoption=document.createElement('option');
        stateoption.setAttribute('value',CStateAbbr[i]);
        if (CStateAbbr[i]==statevalue)
        {
            stateoption.setAttribute('selected','selected');
            found = true;
        }
        stateoption.innerHTML = CStateAbbr[i] + ' (' + CStateName[i] + ')';
        ddl.appendChild(stateoption);
    }

    stateoption=document.createElement('option');
    stateoption.setAttribute('value','customselection');
    stateoption.innerHTML = ' ** ENTER A CUSTOM PROVINCE ** ';

    if (found==false)
    {
        stateoption=document.createElement('option');
        stateoption.setAttribute('value',statevalue);
        stateoption.setAttribute('selected','selected');
        stateoption.innerHTML = statevalue + ' (Custom)';
        ddl.appendChild(stateoption);
    }

    ddl.appendChild(stateoption);

    // Add the drop down and size accordingly.
    statecell.appendChild(ddl);
    ddl.onchange = textState;
    ddl.style.width = '100%';
}

function textState()
{
    // Find drop down and real textbox
    provinceid = 'stateorprovince';

    var stateobject = document.getElementById(provinceid);
    if (!stateobject)
    {
        provinceid = 'address1_stateorprovince';
        stateobject = document.getElementById(provinceid);
    }
    var ddl = document.getElementById('new_stateorprovince');

    // if dropdown value is customselection, show real textbox
    if (ddl.value=='customselection')
    {
        // Get the state or province cell.
        var statecell = document.getElementById(provinceid + '_d');
        statecell.removeChild(ddl);
        stateobject.style.display = 'inline';
    } else {
        // if dropdown is not customselection,
        // put value from ddl into real textbox.
        stateobject.value = ddl.value;
    }

}
</pre>
<p>Then in the form&#8217;s onload event, just add the method <b>ddlState</b> with no parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2011/03/07/crm-2011-change-crm-address-state-to-a-drop-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CRM 4: Change CRM Address State to a drop down box.</title>
		<link>http://mscrmblogger.com/2009/05/11/change-crm-address-state-to-a-drop-down-box/</link>
		<comments>http://mscrmblogger.com/2009/05/11/change-crm-address-state-to-a-drop-down-box/#comments</comments>
		<pubDate>Tue, 12 May 2009 01:35:21 +0000</pubDate>
		<dc:creator>Carlton Colter</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Web Resources]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[crm4]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[lead]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[state]]></category>

		<guid isPermaLink="false">http://mscrmblogger.com/?p=47</guid>
		<description><![CDATA[Do you want a drop down box for the state, but you don't want to break core CRM functionality?  This little onload script will show the states for the United States and Canada (You can always modify it to have more options).  This will help restrict what people put in the state field by providing them a drop down box.  It will also allow them to view the old text box and enter any custom information just by clicking on '* ENTER A CUSTOM PROVINCE *'.]]></description>
			<content:encoded><![CDATA[<p><b>Do you want a drop down box for the state, but you don&#8217;t want to break core CRM functionality?</b></p>
<p>Ok.  This little onload script will show the states for the United States and Canada (You can always modify it to have more options).  This will help restrict what people put in the state field by providing them a drop down box.  It will also allow them to view the old text box and enter any custom information just by clicking on &#8216;* ENTER A CUSTOM PROVINCE *&#8217;.</p>
<p>This script will work on the onload for a lead, contact, account, and sales-contact.</p>
<p><i>Please post a comment and let me know what you think!</i></p>
<p>If you&#8217;re a consultant and you use this, please at least give us credit and provide the customer with the web address to our blog.</p>
<p><b>Onload Jscript Code:</b></p>
<pre name="code" class="javascript">
function ddlState ()
{

	// Get the state or province cell.
	var provinceid = 'stateorprovince';
	var statecell = document.getElementById(provinceid + '_d');

	if (!statecell)
	{
		provinceid = 'address1_stateorprovince';
		statecell = document.getElementById(provinceid + '_d');
	}

	var stateobject = document.getElementById(provinceid);
	stateobject.style.display = 'none';

	var statevalue = stateobject.value;

	var ddl = document.createElement('select');
	ddl.setAttribute('id','new_stateorprovince');
	ddl.setAttribute('class','ms-crm-SelectBox');
	ddl.setAttribute('req','2');
	ddl.setAttribute('height','4');
	ddl.setAttribute('style','IME-MODE: auto');

	// Build some lists.
	var CStateName = new Array();
	var CStateAbbr = new Array();
	var USStateName = new Array();
	var USStateAbbr = new Array();

	// If nothing is entered for state, show SELECT A STATE
	var found=false;
	if (statevalue.length&lt;1)
	{
		stateoption=document.createElement('option');
		stateoption.setAttribute('value','');
		stateoption.innerHTML = ' ** SELECT A STATE ** ';
		ddl.appendChild(stateoption);
		found=true;
	}

	// Build Canada Array
	CStateName[0]  = "Alberta";                   CStateAbbr[0]  = "AB";
	CStateName[1]  = "British Columbia";          CStateAbbr[1]  = "BC";
	CStateName[2]  = "Manitoba";                  CStateAbbr[2]  = "MB";
	CStateName[3]  = "New Brunswick";             CStateAbbr[3]  = "NB";
	CStateName[4]  = "Newfoundland and Labrador"; CStateAbbr[4]  = "NL";
	CStateName[5]  = "Northwest Territories";     CStateAbbr[5]  = "NT";
	CStateName[6]  = "Nova Scotia";               CStateAbbr[6]  = "NS";
	CStateName[7]  = "Nunavut";                   CStateAbbr[7]  = "NU";
	CStateName[8]  = "Ontario";                   CStateAbbr[8]  = "ON";
	CStateName[9]  = "Prince Edward Island";      CStateAbbr[9]  = "PE";
	CStateName[10] = "Quebec";                    CStateAbbr[10] = "QC";
	CStateName[11] = "Saskatchewan";              CStateAbbr[11] = "SK";
	CStateName[12] = "Yukon";                     CStateAbbr[12] = "YT";

	// Build US Array
	USStateName[0]  = "Alabama";        USStateAbbr[0]  = "AL";
	USStateName[1]  = "Alaska";         USStateAbbr[1]  = "AK";
	USStateName[2]  = "Arizona";        USStateAbbr[2]  = "AZ";
	USStateName[3]  = "Arkansas";       USStateAbbr[3]  = "AR";
	USStateName[4]  = "California";     USStateAbbr[4]  = "CA";
	USStateName[5]  = "Colorado";       USStateAbbr[5]  = "CO";
	USStateName[6]  = "Connecticut";    USStateAbbr[6]  = "CT";
	USStateName[7]  = "District of Columbia"; USStateAbbr[7]  = "DC";
	USStateName[8]  = "Delaware";       USStateAbbr[8]  = "DE";
	USStateName[9]  = "Florida";        USStateAbbr[9]  = "FL";
	USStateName[10]  = "Georgia";       USStateAbbr[10]  = "GA";
	USStateName[11] = "Hawaii";         USStateAbbr[11] = "HI";
	USStateName[12] = "Idaho";          USStateAbbr[12] = "ID";
	USStateName[13] = "Illinois";       USStateAbbr[13] = "IL";
	USStateName[14] = "Indiana";        USStateAbbr[14] = "IN";
	USStateName[15] = "Iowa";           USStateAbbr[15] = "IA";
	USStateName[16] = "Kansas";         USStateAbbr[16] = "KS";
	USStateName[17] = "Kentucky";       USStateAbbr[17] = "KY";
	USStateName[18] = "Louisiana";      USStateAbbr[18] = "LA";
	USStateName[19] = "Maine";          USStateAbbr[19] = "ME";
	USStateName[20] = "Maryland";       USStateAbbr[20] = "MD";
	USStateName[21] = "Massachusetts";  USStateAbbr[21] = "MA";
	USStateName[22] = "Michigan";       USStateAbbr[22] = "MI";
	USStateName[23] = "Minnesota";      USStateAbbr[23] = "MN";
	USStateName[24] = "Mississippi";    USStateAbbr[24] = "MS";
	USStateName[25] = "Missouri";       USStateAbbr[25] = "MO";
	USStateName[26] = "Montana";        USStateAbbr[26] = "MT";
	USStateName[27] = "Nebraska";       USStateAbbr[27] = "NE";
	USStateName[28] = "Nevada";         USStateAbbr[28] = "NV";
	USStateName[29] = "New Hampshire";  USStateAbbr[29] = "NH";
	USStateName[30] = "New Jersey";     USStateAbbr[30] = "NJ";
	USStateName[31] = "New Mexico";     USStateAbbr[31] = "NM";
	USStateName[32] = "New York";       USStateAbbr[32] = "NY";
	USStateName[33] = "North Carolina"; USStateAbbr[33] = "NC";
	USStateName[34] = "North Dakota";   USStateAbbr[34] = "ND";
	USStateName[35] = "Ohio";           USStateAbbr[35] = "OH";
	USStateName[36] = "Oklahoma";       USStateAbbr[36] = "OK";
	USStateName[37] = "Oregon";         USStateAbbr[37] = "OR";
	USStateName[38] = "Pennsylvania";   USStateAbbr[38] = "PA";
	USStateName[39] = "Rhode Island";   USStateAbbr[39] = "RI";
	USStateName[40] = "South Carolina"; USStateAbbr[40] = "SC";
	USStateName[41] = "South Dakota";   USStateAbbr[41] = "SD";
	USStateName[42] = "Tennessee";      USStateAbbr[42] = "TN";
	USStateName[43] = "Texas";          USStateAbbr[43] = "TX";
	USStateName[44] = "Utah";           USStateAbbr[44] = "UT";
	USStateName[45] = "Vermont";        USStateAbbr[45] = "VT";
	USStateName[46] = "Virginia";       USStateAbbr[46] = "VA";
	USStateName[47] = "Washington";     USStateAbbr[47] = "WA";
	USStateName[48] = "West Virginia";  USStateAbbr[48] = "WV";
	USStateName[49] = "Wisconsin";      USStateAbbr[49] = "WI";
	USStateName[50] = "Wyoming";        USStateAbbr[50] = "WY";

	// Build the drop down
	var stateoption;
	stateoption=document.createElement('option');
	stateoption.setAttribute('value','');
	stateoption.innerHTML = '---United States--------';
	ddl.appendChild(stateoption);

	var i=0;
	for(i=0;i&lt;USStateName.length;i++)
	{
		stateoption=document.createElement('option');
		stateoption.setAttribute('value',USStateAbbr[i]);
		if (USStateAbbr[i]==statevalue)
		{
			stateoption.setAttribute('selected','selected');
			found = true;
		}
		stateoption.innerHTML = USStateAbbr[i] +
		' (' + USStateName[i] + ')';
		ddl.appendChild(stateoption);
	}

	stateoption=document.createElement('option');
	stateoption.setAttribute('value','');
	stateoption.innerHTML = '---Canada---------------';
	ddl.appendChild(stateoption);

	var i=0;
	for(i=0;i&lt;CStateName.length;i++)
	{
		stateoption=document.createElement('option');
		stateoption.setAttribute('value',CStateAbbr[i]);
		if (CStateAbbr[i]==statevalue)
		{
			stateoption.setAttribute('selected','selected');
			found = true;
		}
		stateoption.innerHTML = CStateAbbr[i] + ' (' + CStateName[i] + ')';
		ddl.appendChild(stateoption);
	}

	stateoption=document.createElement('option');
	stateoption.setAttribute('value','customselection');
	stateoption.innerHTML = ' ** ENTER A CUSTOM PROVINCE ** ';

	if (found==false)
	{
		stateoption=document.createElement('option');
		stateoption.setAttribute('value',statevalue);
		stateoption.setAttribute('selected','selected');
		stateoption.innerHTML = statevalue + ' (Custom)';
		ddl.appendChild(stateoption);
	}

	ddl.appendChild(stateoption);

	// Add the drop down and size accordingly.
	statecell.appendChild(ddl);
	ddl.onchange = textState;
	ddl.style.width = '100%';
}

function textState()
{
	// Find drop down and real textbox
	provinceid = 'stateorprovince';

	var stateobject = document.getElementById(provinceid);
	if (!stateobject)
	{
		provinceid = 'address1_stateorprovince';
		stateobject = document.getElementById(provinceid);
	}
	var ddl = document.getElementById('new_stateorprovince');

	// if dropdown value is customselection, show real textbox
	if (ddl.value=='customselection')
	{
		// Get the state or province cell.
		var statecell = document.getElementById(provinceid + '_d');
		statecell.removeChild(ddl);
		stateobject.style.display = 'inline';
	} else {
		// if dropdown is not customselection,
		// put value from ddl into real textbox.
		stateobject.value = ddl.value;
	}

}
ddlState();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mscrmblogger.com/2009/05/11/change-crm-address-state-to-a-drop-down-box/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

