如何使用href插入文本以记录视图的字段 在糖CRM中



如何用href插入文本以记录sugarcrm

中的视图字段

我们想给出任何文本或记录

的链接
    custom/modules/your_module/metadata/detailviewdefs.php
    array (
       'name' => 'temp_c',
       'label' => 'LBL_TEMP',
       'customCode' => '{if $fields.temp_1_c.value}
        <a href="{$fields.temp_1_c.value}" target="_blank">
        <img src="imgname.png" alt="Img" width="25" height="25" />
        </a>
        {/if} />',

    ),

只需创建URL类型字段:以下是代码:

$dictionary['module_name']['fields']['website'] =  array (
    'labelValue' => 'Website',
    'required' => false,
    'name' => 'website',
    'vname' => 'LBL_WEBSITE',
    'type' => 'url',
    'massupdate' => '0',
    'default' => '',
    'no_default' => false,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'disabled',
    'duplicate_merge_dom_value' => '0',
    'audited' => true,
    'reportable' => true,
    'unified_search' => false,
    'merge_filter' => 'disabled',
    'len' => '255',
    'size' => '20',
    'dbType' => 'varchar',
    'gen' => '',
    'link_target' => '_blank',
);

文件位置应为: Custom Extension Modules Module_name Ext vardefs sugarfield_website.php

最新更新