Note that there are some explanatory texts on larger screens.

plurals
  1. POTroubleshooting dynamic dropdowns in SugarCRM 6.5
    primarykey
    data
    text
    <p>I had asked a question here a while back about setting up database populated dropdowns for SugarCRM. I received a really good answer and, after more php studies and a dev instance running, I decided to give it a shot. The instructions I followed can be found <a href="http://www.eggsurplus.com/home/content/populate-a-dropdown-from-the-database/" rel="nofollow">here</a>. After I run the repair and rebuild, I would expect to see the custom field in my Fields list under the module in studio, but have not been able to find it. The module is named Makers (a1_makers as a database table). For good orders sake, there were no errors when I repaired/rebuilt after saving the files.<br><br> Per the instructions, I first created a php file with a custom function to query the database (custom/Extension/application/Ext/Utils/getMakers.php):<br><br></p> <pre><code>&lt;?php function getMakers() { static $makers = null; if (!$makers){ global $db; $query = "SELECT id, name FROM a1_maker"; $result = $db-&gt;query($query, false); $accounts = array(); $accounts[''] = ''; while (($row = $db-&gt;fetchByAssoc($result)) !=null) { $accounts[$row['id']] = $row['name']; } } return $makers; } ?&gt; </code></pre> <p>Then, I set 'function' field in Vardefs to point to the function (custom/Extension/modules/Maker/Ext/Vardefs/makers_template.php):</p> <pre><code>&lt;?php $dictionary['Maker']['fields']['list_of_makers'] = array ( 'name' =&gt; 'list_of_makers', 'vname' =&gt; 'LBL_MKRLST' 'function' =&gt; 'getMakers', 'type' =&gt; 'enum', 'len' =&gt; '100', 'comment' =&gt; 'List of makers populated from the database', ); ?&gt; </code></pre> <p>Unfortunately, there are no errors and the repair/rebuild runs fine. I am just unable to see the custom field when I go into studio. Can anyone please help point out what I may be doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload