2
我試圖從「機會」報表中檢索數據。報表生成過程中的Sugarcrm從相關字段檢索數據
這是我的場景:機會模塊,字段sales_person
是來自users
模塊的相關字段。
在Bids
模塊我有一個relate
字段與機會。
報告生成過程中,我試圖檢索機會中的sales_person
名稱。但它不在Bids
報告field_lists中列出。
我的字典Bids
'opportunity_id_c' => array(
'required' => false,
'name' => 'opportunity_id_c',
'vname' => 'LBL_OPPORTUNITY_OPPORTUNITY_ID',
'type' => 'id',
'reportable' => true,
'calculated' => false,
'len' => 36,
'size' => '20',
),
'opportunity' => array(
'required' => false,
'source' => 'non-db',
'name' => 'opportunity',
'vname' => 'LBL_OPPORTUNITY',
'type' => 'relate',
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'len' => '255',
'size' => '20',
'id_name' => 'opportunity_id_c',
'ext2' => 'Opportunities',
'module' => 'Opportunities',
'rname' => 'name',
'quicksearch' => 'enabled',
'studio' => 'visible',
),
關係:
$dictionary['Opportunity']['fields']['opportunities_procurements'] = [
'name' => 'opportunities_procurements',
'type' => 'link',
'relationship' => 'opportunities_procurements',
'module' => 'Procurement',
'bean_name' => 'Procurement',
'source' => 'non-db',
'vname' => '',
];
$dictionary['Opportunity']['relationships']['opportunities_procurements'] = [
'lhs_module' => 'Opportunities',
'lhs_table' => 'opportunities',
'lhs_key' => 'id',
'rhs_module' => 'Procurement',
'rhs_table' => 'procurement',
'rhs_key' => 'opportunity_id_c',
'relationship_type' => 'one-to-many',
];
這是我的嘗試:我試圖創建在投標模塊類似場opportunity
命名爲opportunity_sales_user
和字典,而不是'rname' => 'name',
我使用'rname' => 'sales_person',
但我沒有得到數據,因爲sales_person
是相關記錄。我在Reports
中找不到價值。
如何創建完整的關係,以便我可以在Bids
報告生成中獲得sales_person
值?
沒有ü哪裏寫的嗎? – TomPHP
如果你在Dashlet中做了那麼你必須創建自定義的Dashlets –