Domanda

How to add custom subpanel on detail view page without relationship

Eg.: I want to add Accounts subpanel on Leads Detail View Page.

È stato utile?

Soluzione

This might give you an edge towards the correct answer but you should be aware that it is fairly involved.

You can create a custom dashlet by adding a file to the director custom/Extension/modules/Leads/Ext/Layout/name_this_file_anything.php

The content of the file should be something add a new element to the array $layout_defs['Leads']['subpanel_setup']. You can probably find what to add from the layout defs files in the existing modules directory.

If you need to create a custom subpanel that is quite a bit more work and involves creating a function called "getSubpanelQueryParts($params)" which queries the required records and returns an array of query parts and adds an element to the subpanel_setup/custom_dashlet array which reads something like this:

'collection_list' => array(
'calls_opportunities' => array(
    'subpanel_name' => 'ForAccounts',
    'module' => 'Calls',
    'get_subpanel_data' => 'function:getSubpanelQueryParts', // here custom method defined
    'generate_select' => true,             // to build custom SQL query
    'function_parameters' => array(
      'import_function_file' => 'custom/application/Ext/Utils/custom_calls_opportunities.php', 
      'return_as_array' => 'true'
    ), // to get data for subpanel collection item
  ),
),
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top