Chick Chirik
Chick Chirik

Reputation: 115

Custom button behaviour in subpanel

In SuiteCRM I have a module connected with module Contacts. And in this module I created custom button in a subpanel of Contacts which is called "Import". And I want to open the page with import of contacts when I click this button. How can I do it?

 array (
    0 => 
    array (
      'widget_class' => 'SubPanelTopButtonQuickCreate',
    ),
    1 => 
    array (
      'widget_class' => 'SubPanelTopSelectButton',
      'mode' => 'MultiSelect',
    ),  2 =>    array (
      'widget_class' => 'SubPanelImportButton',
    ),

Upvotes: 2

Views: 531

Answers (1)

Mohammad Ali
Mohammad Ali

Reputation: 29

Sugar load widget class from include/generic/SugarWidgets/.* for example you can find definition of SubPanelTopSelectButton in this directory.The code above wont work because you haven't defined any widget class with name SugarWidgetSubPanelImportButton Follow the below mentioned steps to achieve required behaviour:

  1. Create directory in custom/include/generic/SugarWidgets/SugarWidgetSubPanelImportButton.php
  2. Create a class SugarWidgetSubPanelImportButton
  3. Extend this class with SubPanelTopSelectButton
  4. Override the SubPanelTopSelectButton relevant methods in which you would like to change the default behaviour.

Upvotes: 1

Related Questions