doulin6448 2013-01-18 09:13
浏览 44
已采纳

在SugarCRM的View Page中检索引用的表数据

I'm new to PHP and SugarCRM, I wrote own DetailView.php & DetailView.html under my module to make a completely new layout. Already know current bean can be get by below approach

$focus = new PYR_Player();
$detailView = new DetailView();
$offset=0;
$result = $detailView->processSugarBean("PYR_Player", $focus, $offset);

But how to get list data from the referenced table? I tried processUnionBeans but don't know how to get subpanel_definitions. Any ideas?

$query=$detailView->processUnionBeans($focus, $subpanel_definitions, "pyr_player_pyr_balance_CELL");

SugarCRM version is Pro 6.5.8

  • 写回答

1条回答 默认 最新

  • doujiaoang69440 2013-09-30 03:23
    关注

    To custom the query for referenced list in "subpanel", can simply change the "get_subpanel_data" attribute in layoutdefs.ext.php, to specify the custom query

        $layout_defs['Accounts'] = array(
        'subpanel_setup' => array(
            'xxxs' => array(
                'order' => 30,
                'module' => 'xxx',
                'sort_order' => 'desc',
                'sort_by' => 'start_date',
                'subpanel_name' => 'XXXForAccounts',
                'get_subpanel_data' => 'function:get_xxxs_list_query',  // customed query sql.
                'add_subpanel_data' => 'id',
                'title_key' => 'LBL_XXX_SUBPANEL_TITLE',
                'default_hidden' => true,
            ),
        ),
    );
    

    Then Add the function in Account.php

    function get_xxxs_list_query(){ ... return sql;}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序