Customizing Opportunity DetailView with Custom TPL File While Keeping Default Subpanels in SuiteCRM

Hi all,

I’m currently working on customizing the Opportunity DetailView in SuiteCRM, and I need some help. My goal is to replace the default detailviewdefs.php with my own custom TPL file for the Opportunity DetailView while still keeping the default functionality for the subpanels at the bottom.

Here’s what I have done so far:

require_once('modules/Opportunities/views/view.detail.php');

class CustomOpportunitiesViewDetail extends OpportunitiesViewDetail
{
    public function display()
    {
        $smarty = new Sugar_Smarty();
        $smarty->display('custom/modules/Opportunities/tpls/detailView.tpl'); // Custom view
        parent::display(); // Default subpanel functionality
    }
}

The problem I’m encountering is that both my custom view and the default view are being loaded, rather than just my custom TPL file along with the default subpanels.

If I comment out the parent::display() line, the subpanels are no longer rendered, which is not what I want.

What I’m looking for is a solution that:

  1. Displays my custom TPL file (replacing the default detailviewdefs.php).
  2. Keeps the default functionality for subpanels intact (displaying them at the bottom).

I’m open to suggestions or solutions on how to achieve this behavior.

Thanks in advance for your help!