Announcement

Collapse
No announcement yet.

filtering relationshipPanel rows

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • filtering relationshipPanel rows

    I try to filter records on Accounts for my custom entity "Contract" in the relationship panel "contracts" so I defined:

    custom/Espo/Custom/SelectManagers/Contract.php
    Code:
    <?php
    namespace Espo\Custom\SelectManagers;
    
    
    class Contract extends \Espo\Core\SelectManagers\Base
    {
    protected function filterActive(&$result)
    {
    $result['whereClause'][] = array(
    'status' => ['active']
    );
    }
    }
    ?>
    I'm able to filter the related records by accessing /api/v1/Account/{entityId}/contracts?primaryFilter=active

    Unfortunately the "selectPrimaryFilterName" seems to not having any effect:

    custom/Espo/Custom/Resources/metadata/clientDefs/Account.json
    Code:
    {
    "relationshipPanels": {
    "contracts": {
    "selectPrimaryFilterName": "active"
    }
    }
    }
    I cleaned up cache on the server and in my browser but still see browser requests setting an empty filter
    Code:
    primaryFilter=
    Do I miss anything? Is selectPrimaryFilterName the correct property to set a filter in the relationship panel?

    Thanks

  • #2
    as a work around I now set a filter list with first value "active" which has a similar effect to filter on "active" but I still would like to understand correct usage of "selectPrimaryFilterName":
    Code:
    {
    "relationshipPanels": {
    "contracts": {
    "filterList": ["active","all"],
    "selectPrimaryFilterName": "active"
    }
    }
    }

    Comment

    Working...
    X