zoukankan      html  css  js  c++  java
  • SugarCRM 主表自定义字段

    1.创建字段
    \modules\bw_MessageSends\vardefs.php
    文本字段
    'name' =>array (
    'name' => 'name',
    'type' => 'varchar', //还有这些类型 name ,phone , enum , datetime
    'dbType' => 'varchar',
    'vname' => 'LBL_ACCOUNT_NAME', //标签名
    'reportable'=>true,
    'len' => 150,
    ),
    'HomeTel' =>array (
    'name' => 'HomeTel',
    'vname' => 'LBL_HomeTel',
    'type' => 'phone',
    'dbType' => 'varchar',
    'reportable'=>true,
    'len' => 25,
    ),

    下拉菜单字段
    'account_type' => array (
    'name' => 'account_type',
    'vname' => 'LBL_TYPE',
    'type' => 'enum',
    'options' => 'account_type_dom1',
    'reportable'=>true,
    'len'=>25,
    ),
    2.$fields_array[] 数组
    \modules\bw_Msg_MT3101s\field_arrays.php

    $fields_array['bw_Msg_MT3101'] = array (
    'column_fields' => array(
    'id',
    'date_entered',

    'message_id',//自定义字段
    'function_code',
    'message_type',
    'sender_id',
    'receiver_id',
    //BUILDER: included fields

    说明:这部分不写则sql语句生成没有自定义字段,保存不上数据库
    \include\formbase.php 文件中的 populateFromPost() 是将$_POST 的数据赋到 $focus->$field = $value 中。

    3.赋标签
    \modules\bw_MessageSends\language.php
    $mod_strings['LBL_TYPE'] = '报文编号';

    $mod_strings = array (
    'LBL_TYPE' => '发送报文管理',
    4.修复数据库
    修复数据库后vardefs.php 中的字段自动更新至数据库中
  • 相关阅读:
    Springboot 中AOP的使用
    ElasticSearch 聚合查询百分比
    ElasticSearch 入门
    elasticsearch 关联查询
    spring data elasticsearch多索引查询
    elasticsearch 拼音+ik分词,spring data elasticsearch 拼音分词
    es同步mysql同步-logstash
    jpa Specification复杂查询
    java Spring boot使用spring反射
    BeautifulSoup学习记录
  • 原文地址:https://www.cnblogs.com/hailexuexi/p/1953226.html
Copyright © 2011-2022 走看看