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

  • hats

    Is This Procedure Work For Custom Modules And Quoted Line Items ??

    I have tried with custom module and quoted line items. it is not working attaching an image for Reference..

    Fields not showing to Enter Values..

    Help me on this..

Reply Children