Field正在引用错误的数据

时间:2016-01-13 07:00:45

标签: sugarcrm

问题:跟踪字段数据源的最佳方法是什么?

我一直在浏览大量文件,而且我能找到的所有参考文献都是正确的。

问题是“姓氏”字段显示的是联系人全名。

任何想法都将不胜感激。

我正在使用SugarCRM CE 6.5.13
感谢。

1 个答案:

答案 0 :(得分:1)

  1. 字段在modules / SomeModules / vardefs.php中定义,或者如果是a db表fields_meta_data
  2. 中的custom_field 模块bean modules / SomeModules / SomeModule.php中的
  3. 可以覆盖默认行为以生成例如full_name,如下所示:
  4. 详细视图:

        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_proper_name_field:

     /**
     * 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;
    }