Module Contracts - Pop Up - Editing a query within a pop-up? - Filtering

Guys, I'm having trouble relating the module "Contracts" with a custom module named "address" that is also related to "accounts".

Since I already have filled the bill, I wanted to open the pop-up charges is only the "addresses" that linked "Account".

When I do research within a "pop-up" lists all the addresses, my question is how could I do this filtering, someone has been there?


Some images:




  • Hi Bruno

    You can apply an initialFilter on popup, but it will only work on first popup rendering. Just after applying any other filter or paginate it then the initialFilter will reset to all records.

    Another approach would be render it on editview as a regular dropdown. Inside controller action_editview you can force the dropdown options based on related Account. Inside the same method action_editview you can update the type of field in order to become a regular dropdown field. This will apply to editview only, any other view will remain intact.

    Kind regards

  • Hi Andrew,

    I did like how the example below filtering by name, was more or less the solution I wanted, but needs to be done with the Account ID.



    //Change line:

    'top_buttons' =>

       array (

        0 =>

        array (

          'widget_class' => 'SubPanelTopButtonQuickCreate',


        1 =>

        array (

          'widget_class' => 'SubPanelTopSelectButton',

          'mode' => 'MultiSelect',

          'initial_filter_fields' => array(

      //  'account_id' => 'aaa_endereco_accounts_name_advanced', 

          'account_name' => 'aaa_endereco_accounts_name_advanced', 





    //My field to search:

    'aaa_endereco_accounts_name' =>

      array (

        'type' => 'relate',

        'link' => true,



        'width' => '10%',

        'name' => 'aaa_endereco_accounts_name',


    But when the step account_id is this way,


    I should change in some other place or places? ^^

    If you have any examples would be helpful!


  • guys I could not edit the search form or the query , then created a new widget with a drawer that adds relationship via REST , I do not think it's a good practice , but it was the only way that worked for me .