Sugarcrm SuiteRM填充相关字段

Sugarcrm SuiteRM填充相关字段,sugarcrm,suitecrm,auto-populate,Sugarcrm,Suitecrm,Auto Populate,在Opportunity module edit(机会模块编辑)视图中,选择Contact(相关字段)时,我需要自动填充帐户名(相关字段)。 我可以填写联系人和帐户名编辑框,并且只能填写一个id。 这意味着我可以设置联系人或帐户名,但不能设置联系人或帐户名 有人能帮忙吗 array ( 0 => array ( 'name' => 'kontakt_c', 'studio' => 'visible',

在Opportunity module edit(机会模块编辑)视图中,选择Contact(相关字段)时,我需要自动填充帐户名(相关字段)。 我可以填写联系人和帐户名编辑框,并且只能填写一个id。 这意味着我可以设置联系人或帐户名,但不能设置联系人或帐户名

有人能帮忙吗

    array (
      0 => 
      array (
        'name' => 'kontakt_c',
        'studio' => 'visible',
        'label' => 'LBL_KONTAKT',
        'displayParams' => array (
            'field_to_name_array' => array(     
                'id' => 'contact_id_c', 
                'name' => 'kontakt_c',
                'account_name' => 'account_name',
                'account_id' => 'account_id',
                ),
         ),
      ),
      1 => 
        array (
            'name' => 'account_name',
            'studio' => 'visible',
        )
    ),

我更喜欢使用自定义视图,在其中介绍您可能需要的任何javascript代码

首先,在custom/modules/Contacts/views/view.edit.php中构建自定义视图:

<?php

require_once 'modules/Contacts/views/view.edit.php';

class CustomContactsViewEdit extends ContactsViewEdit
{
    public function __construct()
    {
        parent::__construct();
        $this->useForSubpanel = true;
        $this->useModuleQuickCreateTemplate = true;
        // Since the suite base modules name the bean in the singular, we configure in the view the name of the module in the plural. This property will be used by the SticViews class to load the language files
        $this->moduleName = 'Contacts';
    }

    public function preDisplay()
    {
        parent::preDisplay();


        // Write here you custom code
    }

    public function display()
    {
        parent::display();

        echo '<script type="text/javascript" src="custom/modules/Contacts/CustomUtils.js"></script>';
    }
}