<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to change a textfield to a dropdown</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/6238/how-to-change-a-textfield-to-a-dropdown</link><description>I have two fields a customer has asked us to change from a TextField Type to a DropDown Type. It is for alt_address_state, and primary_address_state - we&amp;#39;ve gone through already and made sure the values matched what exists in the current State Dropdown</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to change a textfield to a dropdown</title><link>https://sugarclub.sugarcrm.com/thread/28228?ContentTypeID=1</link><pubDate>Sat, 18 Feb 2023 13:30:11 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:02aa73b4-ee3d-4d17-969e-0c0399cb7c97</guid><dc:creator>John Boyes</dc:creator><description>&lt;p&gt;Last time I tried it, this still worked (&lt;a href="https://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Converting_a_DropDown_Field_to_a_TextField/"&gt;https://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Converting_a_DropDown_Field_to_a_TextField/&lt;/a&gt;):&lt;/p&gt;
&lt;p&gt;Download the custom directory using the Diagnostic Tool on the Admin page&lt;/p&gt;
&lt;p&gt;Find the&amp;nbsp;&lt;span&gt;custom/Extension/modules/Contacts/Ext/Vardefs/sugarfield_primary_address_state.php&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Add the following two lines below&lt;/span&gt;&lt;/p&gt;
&lt;pre class="line-numbers  language-php"&gt;&lt;code class=" language-php"&gt;&lt;span class="token php language-php"&gt;&lt;span class="token variable"&gt;$dictionary&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'Contact'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'fields'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'primary_address_state'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'type'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;&amp;#39;enum&amp;#39;&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;/span&gt;
&lt;span class="token variable"&gt;$dictionary&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'Contact'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'fields'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'primary_address_state'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token punctuation"&gt;[&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;'options'&lt;/span&gt;&lt;span class="token punctuation"&gt;]&lt;/span&gt;&lt;span class="token operator"&gt;=&lt;/span&gt;&lt;span class="token single-quoted-string string"&gt;&amp;#39;state_dom&amp;#39;&lt;/span&gt;&lt;span class="token punctuation"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create a Module Loader Package with the new file&lt;/p&gt;
&lt;p&gt;Install the package&lt;/p&gt;
&lt;p&gt;You may need to adjust the CSS to make it look nice within the FieldSet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change a textfield to a dropdown</title><link>https://sugarclub.sugarcrm.com/thread/28227?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 23:06:16 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:c1f7fb8f-ebb4-4005-a1f4-c4f7a32cdd0c</guid><dc:creator>Francesca Shiekh</dc:creator><description>&lt;p&gt;Back in v6x, before the state dropdown even existed, we added two custom dropdown fields: state_c and province_c&lt;/p&gt;
&lt;p&gt;then added a dependency so that state_c shows if Country = US, and province_c if country = CA, both are hidden if the country is something else.&lt;/p&gt;
&lt;p&gt;You can use a formula field to copy state_c and province_c respectively to the original state field so it&amp;#39;s available in one field for things like document templates and reports.&lt;/p&gt;
&lt;p&gt;A little convoluted, but perhaps this can work for you too.&lt;/p&gt;
&lt;p&gt;FrancescaS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>