how to add SubPanel on create view??

I have created one custom Module. I want to add SubPanel on record Create View of that Module.(like Opportunity module contains Revenue Line Item in its Record Create View) please help me..

Parents
  • Hi Tejas Kulkarni,

    You can add related module subpanel on create view in 2 easy steps.

    Step1: Override the parent module create layout metadata file and add subpanels-create layout to the main-pane components array.

    custom/modules/<your_module_name>/clients/base/layouts/create/create.php

    $viewdefs['<your_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',
                                'components' => array(
                                    array(
                                        'view' => 'create',
                                    ),
                                    //add subpanels-create layout after create view
                                    array(
                                        'layout' => 'subpanels-create',
                                    ),
                                ),
                            ),
                        ),
                        array(
                            'layout' => array(
                                'type' => 'base',
                                'name' => 'preview-pane',
                                'components' => array(
                                    array(
                                        'layout' => 'preview',
                                    ),
                                ),
                            ),
                        ),
                    ),
                    'last_state' => array(
                        'id' => 'create-default',
                    ),
                ),
            ),
        ),
    );

    Step2: Create new subpanels-create layout in your parent module.

    custom/modules/<your_module_name>/clients/base/layout/subpanels-create/subpanels-create.php

    $viewdefs['<your_module_name>']['base']['layout']['subpanels-create'] = array(
      'type' => 'subpanels',
      'components' => array(
        array(
          'layout' => 'subpanel-create',
          'label' => 'LBL_CUSTOM_MODULE_SUBPANEL_TITLE',
          'context' => array(
            'link' => '<link_name_for_related_module>',
          ),
        )
      ),
    );

    Let us know if this helps.

    Regards.

Reply
  • Hi Tejas Kulkarni,

    You can add related module subpanel on create view in 2 easy steps.

    Step1: Override the parent module create layout metadata file and add subpanels-create layout to the main-pane components array.

    custom/modules/<your_module_name>/clients/base/layouts/create/create.php

    $viewdefs['<your_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',
                                'components' => array(
                                    array(
                                        'view' => 'create',
                                    ),
                                    //add subpanels-create layout after create view
                                    array(
                                        'layout' => 'subpanels-create',
                                    ),
                                ),
                            ),
                        ),
                        array(
                            'layout' => array(
                                'type' => 'base',
                                'name' => 'preview-pane',
                                'components' => array(
                                    array(
                                        'layout' => 'preview',
                                    ),
                                ),
                            ),
                        ),
                    ),
                    'last_state' => array(
                        'id' => 'create-default',
                    ),
                ),
            ),
        ),
    );

    Step2: Create new subpanels-create layout in your parent module.

    custom/modules/<your_module_name>/clients/base/layout/subpanels-create/subpanels-create.php

    $viewdefs['<your_module_name>']['base']['layout']['subpanels-create'] = array(
      'type' => 'subpanels',
      'components' => array(
        array(
          'layout' => 'subpanel-create',
          'label' => 'LBL_CUSTOM_MODULE_SUBPANEL_TITLE',
          'context' => array(
            'link' => '<link_name_for_related_module>',
          ),
        )
      ),
    );

    Let us know if this helps.

    Regards.

Children