Subpanel to be Editable Before Create A Record Like Opportunity Revenue Line Items

Is there any way to  Add  Revenue line items For custom Module where we can select revenue line item Before creation of record. How can we do that ?? Help me to solve this....

Has anyone done this?  Are there any examples or posts out there about how to do it?

Alex Nassi hats

Parents
  • Hi Ash,

    Yes, we can do that. Have a look into modules/Opportunities/clients/base/layouts/create/create.php and you will notice that an extra layout called "subpanels-create" been added to the components array after create view component. This layout is defined in modules/Opportunities/clients/base/layouts/subpanels-create/subpanels-create.php

    So now, go to your custom module and copy the following code in

    1. custom/modules/<your_custom_module>/clients/base/layouts/create/create.php

    <?php

    //custom create layout with RLI create layout
    $viewdefs['<custom_module_name>']['base']['layout']['create'] = array(
        'components' => array(
            array(
                'layout' => array(
                    'type' => 'default',
                    'name' => 'sidebar',
                    'components' => array(
                        array(
                            'layout' => array(
                                'type' => 'base',
                                'name' => 'main-pane',
                                'css_class' => 'main-pane span8',
                                'components' => array(
                                    array(
                                        'view' => 'create',
                                    ),
                                    array(
                                        'layout' => 'subpanels-create',
                                    ),
                                ),
                            ),
                        ),
                        array(
                            'layout' => array(
                                'type' => 'base',
                                'name' => 'preview-pane',
                                'components' => array(
                                    array(
                                        'layout' => 'create-preview',
                                    ),
                                ),
                            ),
                        ),
                    ),
                    'last_state' => array(
                        'id' => 'create-default',
                    ),
                ),
            ),
        ),
    );

    where <custom_module_name> is your custom module name you see in the URL while accessing your custom module.

    2. copy following code to custom/modules/<your_custom_module>/clients/base/layouts/subpanels-create/subpanels-create.php

    <?php

    //layout for RLI create
    $viewdefs['<custom_module_name>']['base']['layout']['subpanels-create'] = array(
        'type' => 'subpanels',
        'components' => array(
            array(
                'layout' => 'subpanel-create',
                'label' => 'LBL_RLI_SUBPANEL_TITLE',
                'override_subpanel_list_view' => 'subpanel-for-opportunities-create',
                'context' => array(
                    'link' => '<link_name_with_RLI>',
                ),
            )
        ),
    );

    where <link_name_with_RLI> is the link name for revenue line items module from your custom module.

    Define the label "LBL_RLI_SUBPANEL_TITLE" in custom/Extension/modules/<your_custom_module>/Ext/Language/en_us.lang.php file

    Try quick repair and rebuild and see if you can see the RLI create subpanel during record create in your custom module.

    Let us know if this helps.

    Regards.

    Hats

  • This code has worked for years but has stopped working with a recent upgrade.  Now, the page will no longer scroll if it is bigger than one page.  Has anyone determined how to make this code work with the most recent upgrades.

    I know this code does not work on v13.3 or v14.  I think it worked in v13.2 but can't be sure.

  • I was given a fix for this.

    'css_class' => 'main-pane span8',
    should match what is in the newest versions:
    'css_class' => 'main-pane overflow-y-auto span8',

Reply Children
No Data