<?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>changing an integer field to a relate field</title><link>https://sugarclub.sugarcrm.com/explore/help-forums/enterprise-professional/f/enterprise-professional-questions/2449/changing-an-integer-field-to-a-relate-field</link><description>I created a field for &amp;quot;client_id&amp;quot; which exists across all of my modules, however in the calls module, as well as others I need this field to relate to an accounts module field with similar values. Particularly here I am trying to create a subpanel in</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: changing an integer field to a relate field</title><link>https://sugarclub.sugarcrm.com/thread/8981?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 18:21:07 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:7d19083d-e04b-41dc-a344-ba70539ef17a</guid><dc:creator>Alan Apter</dc:creator><description>&lt;p&gt;Well there&amp;#39;s a false economy for you. But eh, we all have to work with constraints at times.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: changing an integer field to a relate field</title><link>https://sugarclub.sugarcrm.com/thread/8980?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 17:43:20 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:132cf733-8422-461b-a04c-0296bfd557fb</guid><dc:creator>Aleksey Azanyan</dc:creator><description>&lt;p&gt;I would love 7+ but my client wouldn&amp;#39;t be willing to fork out the $ and thank you &lt;span class="emoticon-inline emoticon_grin" style="height:16px;width:16px;"&gt;&lt;/span&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: changing an integer field to a relate field</title><link>https://sugarclub.sugarcrm.com/thread/8979?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 17:27:19 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:5a76f8b8-129c-423f-a2b3-92fbebed286a</guid><dc:creator>Alan Apter</dc:creator><description>&lt;p&gt;Yup, Sugar mechanics can get a bit of getting used to. It has better interfaces in Version 7, but I&amp;#39;m not sure that&amp;#39;s something you want to hear.&lt;/p&gt;&lt;p&gt;Glad it worked out anyway.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: changing an integer field to a relate field</title><link>https://sugarclub.sugarcrm.com/thread/8978?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 15:34:17 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:19409f01-b5d7-49f3-a255-c308b588a224</guid><dc:creator>Aleksey Azanyan</dc:creator><description>&lt;p&gt;Thank you,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I am working with sugar C.E. so what I ended up doing was in /custom/extension/application/ext/utils/ I created a get_calls_subpanel.php file containing your query a bit modified to suit my needs of course &lt;span class="emoticon-inline emoticon_wink" style="height:16px;width:16px;"&gt;&lt;/span&gt;, and redirected from the /custom/modules/accounts/ext/layoutdefs/calls_accounts_1_accounts.php relationship file by adding:&lt;/p&gt;&lt;p&gt;&amp;#39;get_subpanel_data&amp;#39; =&amp;gt; &amp;#39;function:get_cc_subpanel&amp;#39;,&lt;br /&gt; &amp;#39;generate_select&amp;#39; =&amp;gt; true,&lt;br /&gt; &amp;#39;function_parameters&amp;#39; =&amp;gt; array(&lt;br /&gt; // File where the above function is defined at&lt;br /&gt; &amp;#39;import_function_file&amp;#39; =&amp;gt; &amp;#39;custom/application/Ext/Utils/custom_utils.ext.php&amp;#39;,&lt;br /&gt; ),&lt;/p&gt;&lt;p&gt;which got the job done. Thank you for the direction, it helped quiet a bit. I seem to get stuck on sugar mechanics quiet a bit lol, sql queries, php, java, not so much but the parts that are generic to sugar seem to stump me every once in a while. Like right now I am trying to grab the name field from the accounts module and feed it into the subpanel on quickcreate but I can&amp;#39;t seem to get the variable to populate correctly using $bean-&amp;gt;name; results in nothing and using $this-&amp;gt;bean-&amp;gt;name; has no result either. Even though I know that the field has a value it doesn&amp;#39;t return one.&amp;nbsp;&lt;/p&gt;&lt;p&gt;so in my view.edit.php(i created a copy in a view folder under custom.) I am trying to get it to return a value. I know it returns a value as I am using $this-&amp;gt;ss-&amp;gt;assign(&amp;#39;&amp;lt;my variable name&amp;gt;, &amp;quot;text&amp;quot;); and that shows up on screen, however I cannot seem to grab the value of the field &amp;#39;name&amp;#39; and have it return. So something like:&lt;/p&gt;&lt;p&gt;&lt;span&gt;$this-&amp;gt;ss-&amp;gt;assign(&amp;#39;&amp;lt;my variable name&amp;gt;, $this-&amp;gt;bean-&amp;gt;name);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;doesn&amp;#39;t work &lt;span class="emoticon_sad emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: changing an integer field to a relate field</title><link>https://sugarclub.sugarcrm.com/thread/8977?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 08:33:54 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:187c65d1-8ac0-44a4-bfa8-a44a4102d06a</guid><dc:creator>Alan Apter</dc:creator><description>&lt;p&gt;There&amp;#39;s a guide to how to create a subpanel from a custom query here -&amp;nbsp;&lt;a href="https://developer.sugarcrm.com/2015/05/18/creating-subpanels-with-custom-results-in-sugar-7-5/" rel="nofollow" target="_blank"&gt;https://developer.sugarcrm.com/2015/05/18/creating-subpanels-with-custom-results-in-sugar-7-5/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In your case, the query (in the accounts module) would be something like:&lt;/p&gt;&lt;pre class="language-php line-numbers"&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="keyword token"&gt;protected&lt;/span&gt; &lt;span class="keyword token"&gt;function&lt;/span&gt; &lt;span class="token function"&gt;getCustomJoin&lt;/span&gt;&lt;span class="punctuation token"&gt;(&lt;/span&gt;&lt;span class="variable token"&gt;$params&lt;/span&gt; &lt;span class="operator token"&gt;=&lt;/span&gt; &lt;span class="keyword token"&gt;array&lt;/span&gt;&lt;span class="punctuation token"&gt;(&lt;/span&gt;&lt;span class="punctuation token"&gt;)&lt;/span&gt;&lt;span class="punctuation token"&gt;)&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="punctuation token"&gt;{&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="variable token"&gt;$sql&lt;/span&gt; &lt;span class="operator token"&gt;=&lt;/span&gt; &lt;span class="string token"&gt;&amp;quot; JOIN (&amp;quot;&lt;/span&gt;&lt;span class="punctuation token"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="variable token"&gt;$sql&lt;/span&gt; &lt;span class="punctuation token"&gt;.&lt;/span&gt;&lt;span class="operator token"&gt;=&lt;/span&gt; &lt;span class="operator token"&gt;&amp;lt;&lt;/span&gt;&lt;span class="operator token"&gt;&amp;lt;&lt;/span&gt;&lt;span class="operator token"&gt;&amp;lt;&lt;/span&gt;&lt;span class="token constant"&gt;MYCUSTOMQUERY&lt;/span&gt;&lt;br /&gt;&lt;span class="token constant"&gt;SELECT&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; calls&lt;span class="punctuation token"&gt;.&lt;/span&gt;id &lt;span class="keyword token"&gt;AS&lt;/span&gt; my_custom_id&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="token constant"&gt;FROM&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calls&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="token constant"&gt;WHERE&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calls&lt;span class="punctuation token"&gt;.&lt;/span&gt;deleted &lt;span class="operator token"&gt;=&lt;/span&gt; &lt;span class="number token"&gt;0&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="keyword token"&gt;AND&lt;/span&gt; calls&lt;span class="punctuation token"&gt;.&lt;/span&gt;client_id &lt;span class="operator token"&gt;=&lt;/span&gt; &lt;span class="string token"&gt;&amp;#39;{$this-&amp;gt;focus-&amp;gt;client_id}&amp;#39;&lt;/span&gt;&lt;br /&gt;&lt;span class="token constant"&gt;MYCUSTOMQUERY&lt;/span&gt;&lt;span class="punctuation token"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="variable token"&gt;$sql&lt;/span&gt; &lt;span class="punctuation token"&gt;.&lt;/span&gt;&lt;span class="operator token"&gt;=&lt;/span&gt; &lt;span class="string token"&gt;&amp;quot;) calls_to_show ON calls_to_show.my_custom_id = calls.id&amp;quot;&lt;/span&gt;&lt;span class="punctuation token"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="keyword token"&gt;return&lt;/span&gt; &lt;span class="variable token"&gt;$sql&lt;/span&gt;&lt;span class="punctuation token"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="punctuation token"&gt;}&lt;/span&gt;&lt;span class="line-numbers-rows"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>