Php SugarCRM 6.5中的动态下拉菜单故障排除
我在这里问了一个关于为SugarCRM设置数据库填充下拉列表的问题。我得到了一个非常好的答案,在进行了更多的php研究并运行了一个开发实例之后,我决定试一试。我遵循的说明可以找到。在我运行修复和重建之后,我希望在studio中的模块下的字段列表中看到自定义字段,但未能找到它。该模块名为Makers(a1_Makers作为数据库表)。为了方便起见,在保存文件后修复/重建时没有出现错误。Php SugarCRM 6.5中的动态下拉菜单故障排除,php,mysql,sugarcrm,Php,Mysql,Sugarcrm,我在这里问了一个关于为SugarCRM设置数据库填充下拉列表的问题。我得到了一个非常好的答案,在进行了更多的php研究并运行了一个开发实例之后,我决定试一试。我遵循的说明可以找到。在我运行修复和重建之后,我希望在studio中的模块下的字段列表中看到自定义字段,但未能找到它。该模块名为Makers(a1_Makers作为数据库表)。为了方便起见,在保存文件后修复/重建时没有出现错误。按照说明,我首先创建了一个带有自定义函数的php文件来查询数据库(custom/Extension/applica
按照说明,我首先创建了一个带有自定义函数的php文件来查询数据库(custom/Extension/application/Ext/Utils/getMakers.php):
然后,我在Vardefs中设置“function”字段以指向函数(custom/Extension/modules/Maker/Ext/Vardefs/makers\u template.php):
不幸的是,没有错误,修复/重建运行正常。当我进入studio时,我无法看到自定义字段。有人能帮我指出我可能做错了什么吗?我建议检查
cache/modules/Maker/Makervardefs.php
文件中是否存在新创建的字段“制造商列表”。如果该文件中存在新的字段定义,请尝试将'studio'=>'visible'
添加到custom/Extension/modules/Maker/Ext/Vardefs/makers\u template.php
以获得如下内容:
<?php
$dictionary['Maker']['fields']['list_of_makers'] = array (
'name' => 'list_of_makers',
'vname' => 'LBL_MKRLST'
'function' => 'getMakers',
'type' => 'enum',
'studio' => 'visible'
'len' => '100',
'comment' => 'List of makers populated from the database',
);
谢谢,这肯定有助于澄清问题。添加studio=>visible字段不起作用,但我接受了您的建议,能够编辑editviewdefs.php文件以使其工作。我不知道为什么该字段没有加载到Vardefs/makers_template.php中,但我想我必须通过每个view.php文件单独添加这些字段。非常感谢!你能解释一下这是如何解决这个问题的吗?通过添加这个“studio”=>数组('listview'=>true,'detailview'=>true,'editview'=>true),可以在studio中使用字段。
<?php
$dictionary['Maker']['fields']['list_of_makers'] = array (
'name' => 'list_of_makers',
'vname' => 'LBL_MKRLST'
'function' => 'getMakers',
'type' => 'enum',
'len' => '100',
'comment' => 'List of makers populated from the database',
);
?>
<?php
$dictionary['Maker']['fields']['list_of_makers'] = array (
'name' => 'list_of_makers',
'vname' => 'LBL_MKRLST'
'function' => 'getMakers',
'type' => 'enum',
'studio' => 'visible'
'len' => '100',
'comment' => 'List of makers populated from the database',
);
$dictionary['Maker']['fields']['list_of_makers'] = array (
'name' => 'list_of_makers',
'vname' => 'LBL_MKRLST'
'function' => 'getMakers',
'type' => 'enum',
'studio' => 'visible'
'len' => '100',
'comment' => 'List of makers populated from the database',
'studio' => array(
'listview' => true,
'detailview' => true,
'editview' => true
),
);