Integrating a customized module as a panel in the Opportunity creation view, similar in appearance and behavior to the Revenue Line Items (RLIs) panel

I created a new module called Contract Offices, which has a one-to-many relationship with Opportunities. The creation appears to be successful, as the Contract Offices subpanel now shows up on an Opportunity record.

However, it's not appearing during Opportunity creation the same way as the Revenue Line Items (RLIs) panel.

Does anyone know how to?

Parents
  • Hello  , 


    Thanks for this question. 

    If you’re looking to expose your custom module in the subpanel of the Opportunities module on the Create view, this will require a bit of code customization. You can try the following steps:

    1- Copy the file from:
    modules/Opportunities/clients/base/layouts/subpanels-create/subpanels-create.php

    2 - Paste it into:

    custom/Extension/modules/Opportunities/Ext/clients/base/layouts/subpanels-create/subpanels-create.php


    3 - In the copied file, add your custom module to the layout. I created a similar module as a test, and here’s what my modified file looks like (make sure you adapt for your module name and label)

    <?php
    
    $viewdefs['Opportunities']['base']['layout']['subpanels-create'] = [
        'type' => 'subpanels',
        'components' => [
            [
                'layout' => 'subpanel-create',
                'label' => 'LBL_RLI_SUBPANEL_TITLE',
                'override_subpanel_list_view' => 'subpanel-for-opportunities-create',
                'context' => [
                    'link' => 'revenuelineitems',
                ],
            ],
            [
                'layout' => 'subpanel-create',
                'label' => 'LBL_CO_CONTRACTOFFICE_OPPORTUNITIES_FROM_CO_CONTRACTOFFICE_TITLE',
                'context' => [
                    'link' => 'co_contractoffice_opportunities',
                ],
            ],
        ],
    ];
    


    4 - Run a QRR

    This will be the end result. 





    Let me know if this is what you were aiming for, or if you’d like help refining it further.

    Cheers,

    André

  • Hi André,

    Thanks for the advice, and apologies for the delayed response.

    I’ve just followed your instructions on Sugar Local, but I couldn’t find a folder named subpanels-create for either step 1 or 2. Does this mean I should go ahead and create one specifically for this purpose?

    Also, I came across a PHP file at this path: 

    custom/Extension/modules/Opportunities/Ext/clients/base/layouts/subpanels/_overridesubpanel-for-opportunities-revenuelineitems.php

    <?php
    //auto-generated file DO NOT EDIT
    $viewdefs['Opportunities']['base']['layout']['subpanels']['components'][]['override_subpanel_list_view'] = array (
      'link' => 'revenuelineitems',
      'view' => 'subpanel-for-opportunities-revenuelineitems',
    );
    

    Just wanted to check—am I heading in the right direction?

    Best regards,
    Vy

  • Hello  , 

    In Step 1, you should be checking the core file (outside the custom folder). You can find it here:
    SugarFolder/modules/Opportunities/clients/base/layouts/subpanels-create/subpanels-create.php

    In Step 2, you’ll need to create the full folder structure under the custom directory if it doesn’t already exist:
    SugarFolder/custom/modules/Opportunities/clients/base/layouts/subpanels-create/subpanels-create.php


    Let me know if you managed to find it. 

    Cheers, 

    André 

  • Hi  ,

    Thank you once again for your detailed instructions.

    I’ve successfully implemented the code changes and added the Contract Office as a newly created module to the Opportunity Creation layout.

    By default, the Contract Office subpanel only displays the name and modified date columns. However, I’d like to include additional fields such as address, contact details, email addresses, etc. Would you be able to assist with this?

    Best,

    Vy

  • Hello  , 

    You can give it a try by copying the file from: 

    modules/{ContractOfficeModuleName}/clients/base/views/subpanel-list/subpanel-list.php

    to 

    custom/modules/{ContractOfficeModuleName}/clients/base/views/subpanel-list/subpanel-list.php

    And add the necessary fields there. 

    let me know if this works.

    Cheers, 

    André 

  • Hey  

    Thanks so much for the suggestion but saddly it didnt work.

    I think it should be something override like Revenuelineitem.

    Anyway, thank you

    Best,

    Vy

Reply Children
No Data