<?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>Button Field - How to embed the &amp;quot;definition&amp;quot; in a vardef file instead of partial DB storage</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/6700/button-field---how-to-embed-the-definition-in-a-vardef-file-instead-of-partial-db-storage</link><description>Hi Guys, 
 
 I have a quick question : do you know how to store in a vardef file the FULL definition of a button field (instead of the current storage when created from the studio with partial storage in DB table) ? 
 
 The purpose of this request is</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Button Field - How to embed the "definition" in a vardef file instead of partial DB storage</title><link>https://sugarclub.sugarcrm.com/thread/29796?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 16:35:27 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:b4c8db07-8425-42c1-a962-44c26553a15e</guid><dc:creator>Harald Kuske</dc:creator><description>&lt;p&gt;If you create such a button in studio you get the full vardef description in cache/modules/MODULE/MODULEvardefs.php. As an example I created&amp;nbsp; button in Accounts which results in the following vardef code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="php"&gt;    &amp;#39;button1_c&amp;#39; =&amp;gt; 
    array (
      &amp;#39;labelValue&amp;#39; =&amp;gt; &amp;#39;Button1&amp;#39;,
      &amp;#39;required&amp;#39; =&amp;gt; false,
      &amp;#39;readonly&amp;#39; =&amp;gt; true,
      &amp;#39;source&amp;#39; =&amp;gt; &amp;#39;non-db&amp;#39;,
      &amp;#39;name&amp;#39; =&amp;gt; &amp;#39;button1_c&amp;#39;,
      &amp;#39;vname&amp;#39; =&amp;gt; &amp;#39;LBL_BUTTON1&amp;#39;,
      &amp;#39;type&amp;#39; =&amp;gt; &amp;#39;actionbutton&amp;#39;,
      &amp;#39;massupdate&amp;#39; =&amp;gt; false,
      &amp;#39;hidemassupdate&amp;#39; =&amp;gt; false,
      &amp;#39;no_default&amp;#39; =&amp;gt; false,
      &amp;#39;comments&amp;#39; =&amp;gt; &amp;#39;Comment for Button 1&amp;#39;,
      &amp;#39;help&amp;#39; =&amp;gt; &amp;#39;Help for Button 1&amp;#39;,
      &amp;#39;importable&amp;#39; =&amp;gt; &amp;#39;true&amp;#39;,
      &amp;#39;duplicate_merge&amp;#39; =&amp;gt; &amp;#39;enabled&amp;#39;,
      &amp;#39;duplicate_merge_dom_value&amp;#39; =&amp;gt; 1,
      &amp;#39;audited&amp;#39; =&amp;gt; false,
      &amp;#39;reportable&amp;#39; =&amp;gt; true,
      &amp;#39;unified_search&amp;#39; =&amp;gt; false,
      &amp;#39;merge_filter&amp;#39; =&amp;gt; &amp;#39;disabled&amp;#39;,
      &amp;#39;pii&amp;#39; =&amp;gt; false,
      &amp;#39;calculated&amp;#39; =&amp;gt; false,
      &amp;#39;size&amp;#39; =&amp;gt; 50,
      &amp;#39;studio&amp;#39; =&amp;gt; 
      array (
        &amp;#39;editField&amp;#39; =&amp;gt; true,
        &amp;#39;recordview&amp;#39; =&amp;gt; true,
        &amp;#39;previewview&amp;#39; =&amp;gt; true,
        &amp;#39;recorddashletview&amp;#39; =&amp;gt; true,
        &amp;#39;listview&amp;#39; =&amp;gt; false,
        &amp;#39;wirelesseditview&amp;#39; =&amp;gt; true,
        &amp;#39;wirelesslistview&amp;#39; =&amp;gt; false,
        &amp;#39;wirelessdetailview&amp;#39; =&amp;gt; true,
        &amp;#39;wireless_basic_search&amp;#39; =&amp;gt; false,
        &amp;#39;wireless_advanced_search&amp;#39; =&amp;gt; false,
      ),
      &amp;#39;dbType&amp;#39; =&amp;gt; &amp;#39;text&amp;#39;,
      &amp;#39;options&amp;#39; =&amp;gt; &amp;#39;{&amp;quot;settings&amp;quot;:{&amp;quot;type&amp;quot;:&amp;quot;YnV0dG9u&amp;quot;,&amp;quot;size&amp;quot;:&amp;quot;ZGVmYXVsdA==&amp;quot;,&amp;quot;showFieldLabel&amp;quot;:false,&amp;quot;showInRecordHeader&amp;quot;:false,&amp;quot;hideOnEdit&amp;quot;:false},&amp;quot;actionMenu&amp;quot;:{&amp;quot;orderNumber&amp;quot;:1,&amp;quot;listView&amp;quot;:true,&amp;quot;recordView&amp;quot;:false,&amp;quot;recordViewDashlet&amp;quot;:false,&amp;quot;subpanels&amp;quot;:true},&amp;quot;buttons&amp;quot;:{&amp;quot;0cbbfd0d-7cd1-419b-ac83-1d23b4f40aff&amp;quot;:{&amp;quot;active&amp;quot;:true,&amp;quot;buttonId&amp;quot;:&amp;quot;MGNiYmZkMGQtN2NkMS00MTliLWFjODMtMWQyM2I0ZjQwYWZm&amp;quot;,&amp;quot;orderNumber&amp;quot;:0,&amp;quot;properties&amp;quot;:{&amp;quot;label&amp;quot;:&amp;quot;Q1JFQVRF&amp;quot;,&amp;quot;description&amp;quot;:&amp;quot;VG9vbHRpcCB0ZWN0&amp;quot;,&amp;quot;showLabel&amp;quot;:true,&amp;quot;showIcon&amp;quot;:true,&amp;quot;colorScheme&amp;quot;:&amp;quot;cHJpbWFyeQ==&amp;quot;,&amp;quot;icon&amp;quot;:&amp;quot;c2ljb24tZm9sZGVyLW9wZW4=&amp;quot;,&amp;quot;isDependent&amp;quot;:false,&amp;quot;stopOnError&amp;quot;:false,&amp;quot;formula&amp;quot;:&amp;quot;&amp;quot;},&amp;quot;actions&amp;quot;:{&amp;quot;7ab2e8b4-eb24-48bf-a751-354025647579&amp;quot;:{&amp;quot;actionType&amp;quot;:&amp;quot;Y3JlYXRlLXJlY29yZA==&amp;quot;,&amp;quot;orderNumber&amp;quot;:0,&amp;quot;properties&amp;quot;:{&amp;quot;attributes&amp;quot;:{},&amp;quot;parentAttributes&amp;quot;:{},&amp;quot;module&amp;quot;:&amp;quot;QWNjb3VudHM=&amp;quot;,&amp;quot;link&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;mustLinkRecord&amp;quot;:false,&amp;quot;copyFromParent&amp;quot;:true,&amp;quot;autoCreate&amp;quot;:false}}}}}}&amp;#39;,
      &amp;#39;id&amp;#39; =&amp;gt; &amp;#39;e648add0-4b3f-11ee-a848-54ee7593936c&amp;#39;,
      &amp;#39;custom_module&amp;#39; =&amp;gt; &amp;#39;Accounts&amp;#39;,
    ),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Most complicated part is the options field which is generated by the QR&amp;amp;R from the DB definition.&lt;/p&gt;
&lt;p&gt;In a development environment you have access to the cache folder and you can extract this definition form the vardef file to include it in custom/Extension/modules/MODULEs/Ext/Vardefs/ folder and by this in GIT.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Field - How to embed the "definition" in a vardef file instead of partial DB storage</title><link>https://sugarclub.sugarcrm.com/thread/29775?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 15:26:23 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:50cbe1dd-8d2c-43e7-bb0f-19fd12a4329b</guid><dc:creator>Rafael Fernandes</dc:creator><description>&lt;p&gt;&lt;a href="/members/frinaldi"&gt;Frédéric Rinaldi&lt;/a&gt;&amp;nbsp;interesting solution, thanks for sharing..&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Field - How to embed the "definition" in a vardef file instead of partial DB storage</title><link>https://sugarclub.sugarcrm.com/thread/29773?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 14:51:32 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:2acf9917-1d9f-4110-a1f0-f1348ecf04f7</guid><dc:creator>Fr&amp;#233;d&amp;#233;ric Rinaldi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/rafael-fernandes"&gt;Rafael Fernandes&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;today we do this that way&lt;/p&gt;
&lt;p&gt;1 ) create a sugarfield_the_name_of_my_button.php in&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;custom/Extension/modules/&amp;lt;MODULE_NAME&amp;gt;/Ext/Vardefs&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;2) include a basic definition for the field&lt;/p&gt;
&lt;p&gt;&lt;span class="ui-provider fy b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak" dir="ltr"&gt;&lt;pre class="ui-code" data-mode="php"&gt;&amp;lt;?php
// this file was created by dotBase the ...
$dictionary[&amp;#39;MODULE_NAME&amp;#39;][&amp;#39;fields&amp;#39;][&amp;#39;the_name_of_my_button&amp;#39;][&amp;#39;name&amp;#39;]=&amp;#39;the_name_of_my_button&amp;#39;;
$dictionary[&amp;#39;MODULE_NAME&amp;#39;][&amp;#39;fields&amp;#39;][&amp;#39;the_name_of_my_button&amp;#39;][&amp;#39;vname&amp;#39;]=&amp;#39;LBL_THE_NAME_OF_MY_BUTTON&amp;#39;;
$dictionary[&amp;#39;MODULE_NAME&amp;#39;][&amp;#39;fields&amp;#39;][&amp;#39;the_name_of_my_button&amp;#39;][&amp;#39;type&amp;#39;]=&amp;#39;actionbutton&amp;#39;;
$dictionary[&amp;#39;MODULE_NAME&amp;#39;][&amp;#39;fields&amp;#39;][&amp;#39;the_name_of_my_button&amp;#39;][&amp;#39;options&amp;#39;]=&amp;#39;&amp;#39;;
$dictionary[&amp;#39;MODULE_NAME&amp;#39;][&amp;#39;fields&amp;#39;][&amp;#39;the_name_of_my_button&amp;#39;][&amp;#39;dbType&amp;#39;]=&amp;#39;text&amp;#39;;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3) launch a quick repair and run the query to align DB and code&lt;/p&gt;
&lt;p&gt;4) finish the button configuration from studio, so all the settings will be stored inside the sugarfield_xxx instead of fields_metadata&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;OF COURSE, we are aware that this field is not seen as a custom field and so created in the main table.&lt;/p&gt;
&lt;p&gt;But this is a most convenient way for us to track code customisation / versionning using GIT, even more with mutliple environnement (DEV, STAGING, PROD etc.).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope it helps,&lt;/p&gt;
&lt;p&gt;Fred&lt;/p&gt;
&lt;div id="ext-mouse-move"&gt;&lt;/div&gt;
&lt;div id="ext-mouse-down"&gt;&lt;/div&gt;
&lt;div id="ext-mouse-up"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Field - How to embed the "definition" in a vardef file instead of partial DB storage</title><link>https://sugarclub.sugarcrm.com/thread/29771?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 14:29:26 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:81140848-f1ad-4d3c-8646-668e22d687ef</guid><dc:creator>Rafael Fernandes</dc:creator><description>&lt;p&gt;&lt;a href="/members/frinaldi"&gt;Frédéric Rinaldi&lt;/a&gt;&amp;nbsp;I am interested &lt;span class="emoticon" data-url="https://sugarclub.sugarcrm.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Field - How to embed the "definition" in a vardef file instead of partial DB storage</title><link>https://sugarclub.sugarcrm.com/thread/29770?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 11:55:47 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:48dd80cb-994f-4d33-9acb-fc03f29ec1e8</guid><dc:creator>Fr&amp;#233;d&amp;#233;ric Rinaldi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;we figured how to do it, so if some of you are interested, contact me.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Fred&lt;/p&gt;
&lt;div id="ext-mouse-move"&gt;&lt;/div&gt;
&lt;div id="ext-mouse-down"&gt;&lt;/div&gt;
&lt;div id="ext-mouse-up"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>