<?xml version="1.0" encoding="utf-8"?>
<rss
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 version="2.0">
<channel>
<title>Customer Effective Blog</title>
<link>http://blog.CustomerEffective.com/blog/</link>
<description>Microsoft Dynamics CRM Blog from Customer Effective, CRM Experts and a Microsoft Inner Circle partner.</description>
<language>en-US</language>
<lastBuildDate>Fri, 17 Feb 2012 08:39:00 -0500</lastBuildDate>
<generator>http://www.typepad.com/</generator>
<item>
<title>Deleting Picklist Values Based on CRM Form Types</title>
<link>http://blog.CustomerEffective.com/blog/2009/02/deleting-picklist-values-based-on-crm-form-types.html</link>
<guid isPermaLink="true">http://blog.CustomerEffective.com/blog/2009/02/deleting-picklist-values-based-on-crm-form-types.html</guid>
<description>Sometimes there is a need to remove certain pick list values when a user is creating a new account record in CRM especially when the accounts are integrated with an ERP system such as Great Plains. The scenario is this:...</description>
<content:encoded>&lt;p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;Sometimes there is a need to remove certain pick list values when a user is creating a new account record in CRM especially when the accounts are integrated with an ERP system such as Great Plains.&amp;#0160; The scenario is this:&amp;#0160; All customer records are integrated with CRM, and when the account is flagged as a customer, the entity becomes read only.&amp;#0160; Prospects are entered into CRM and users were accidentally selecting &amp;quot;customer&amp;quot; as the account relationship type, and the account is now locked down and no changes can be made.&amp;#0160; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;To accommodate this request, we created the following &lt;strong&gt;onload &lt;/strong&gt;Javascript on the Account form:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&amp;#0160;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;if(crmForm.FormType ==1)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;var oField = crmForm.all.customertypecode;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;oField.DeleteOption(3);&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&amp;#0160;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;if(crmForm.FormType ==2 &amp;amp;&amp;amp;&amp;#0160; &lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;crmForm.all.customertypecode.DataValue !=&amp;quot;3&amp;quot;)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;var oField = crmForm.all.customertypecode;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;oField.DeleteOption(3);&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&amp;#0160;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;Other options for pick list values include:&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; COLOR: #1f497d; FONT-FAMILY: Arial&quot;&gt;&lt;span style=&quot;FONT-SIZE: 14px; FONT-FAMILY: Arial&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;COLOR: #1f497d&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;FONT-SIZE: 14px; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;var oField = crmForm.all.SOME_PICKLIST_FIELD_ID;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&amp;#0160;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;// Determine how many items there are in the picklist&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;alert(oField.Options.length);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&amp;#0160;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;// Set the value to 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;oField.DataValue = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&amp;#0160;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;// Show the the text for option #1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;alert(oField.SelectedText);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&amp;#0160;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;// Delete the first option by value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;oField.DeleteOption(0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&amp;#0160;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;// Add an option to the pick list, note that the CRM Platform must be aware of this information&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;oField.AddOption(&amp;quot;Test&amp;quot;, 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;MARGIN: 0in 0in 0pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; MARGIN: 0in 0in 0pt; FONT-FAMILY: Arial&quot;&gt;&amp;#0160;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&amp;#0160;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;FONT-SIZE: 15px; FONT-FAMILY: Arial&quot;&gt;&lt;/span&gt;&amp;#0160;&lt;/p&gt;&lt;/p&gt;</content:encoded>



<dc:creator>Dena Harrell</dc:creator>
<pubDate>Thu, 19 Feb 2009 11:17:58 -0500</pubDate>

</item>

</channel>
</rss>

<!-- ph=1 -->

