Sugarcrm 字段引用了错误的数据
问题:跟踪fields数据源的最佳方式是什么 我查阅了很多文件,我能找到的所有参考资料都是正确的 问题是“姓氏”字段显示了联系人的全名 任何想法都将不胜感激 我正在与SugarCRM CE 6.5.13合作Sugarcrm 字段引用了错误的数据,sugarcrm,Sugarcrm,问题:跟踪fields数据源的最佳方式是什么 我查阅了很多文件,我能找到的所有参考资料都是正确的 问题是“姓氏”字段显示了联系人的全名 任何想法都将不胜感激 我正在与SugarCRM CE 6.5.13合作 谢谢 字段在modules/SomeModules/vardefs.php中定义,如果是 数据库表字段\元数据中的自定义\字段 在modules bean modules/SomeModules/SomeModule.php中,您可以覆盖默认行为以生成一个全名,例如如下所示: 有关详细视图:
谢谢
function fill_in_additional_detail_fields() {
parent::fill_in_additional_detail_fields();
$this->full_name = 'Something else';
}
对于列表视图:
function fill_in_additional_list_fields() {
parent::fill_in_additional_list_fields();
$this->full_name = 'Something else';
}
或者通过覆盖标准函数_create_property_name_字段:
/**
* This function helps generate the name and full_name member field
* variables from the salutation, title, first_name and last_name fields.
* It takes into account the locale format settings as well as ACL settings
* if supported.
*/
public function _create_proper_name_field() {
parent::_create_proper_name_field();
$full_name = trim(trim($this->first_name) . ' ' . trim($this->last_name));
if (!empty($full_name) && !empty($this->name)) {
$full_name .= ' - ';
}
if (!empty($this->name)) {
$full_name .= $this->name;
}
$this->full_name = $full_name;
}
再次感谢您富有洞察力和完整的回答。通过您共享的信息,我能够找到错误,尽管我无法完全使用您的代码示例来解决问题,但您确实通过清晰的解释帮助我找到了问题。最后,我只是使用substr()读取字段值,然后删除firstname和尾随空格,然后将剩余的lastname传递给字段。再次感谢你。