Hello,
I have added the boolean field cHidden to the entity Account.
In list view I only want to show accounts which are not hidden.
I have added a primary filter to select only active records, but still all records are shown.
What am I doing wrong?
Following this post https://forum.espocrm.com/forum/deve...-espocrm-7-0-x I have setup the following:
/custom/Espo/Custom/Select/Account/PrimaryFilters/Active.php
/custom/Espo/Custom/Resources/metadata/selectDefs/Account.json
/custom/Espo/Custom/Resources/metadata/clientDefs/Account.json
/custom/Espo/Custom/Resources/i18n/de_DE/Account.json
I have added the boolean field cHidden to the entity Account.
In list view I only want to show accounts which are not hidden.
I have added a primary filter to select only active records, but still all records are shown.
What am I doing wrong?
Following this post https://forum.espocrm.com/forum/deve...-espocrm-7-0-x I have setup the following:
/custom/Espo/Custom/Select/Account/PrimaryFilters/Active.php
PHP Code:
<?php
namespace Espo\Custom\Select\Account\PrimaryFilters;
use Espo\Core\Select\Primary\Filter;
use Espo\ORM\Query\SelectBuilder;
class Active implements Filter
{
public function apply(SelectBuilder $queryBuilder): void
{
$queryBuilder->where([
'cHidden' => false,
]);
}
}
Code:
{
"primaryFilterClassNameMap": {
"active": "Espo\\Custom\\Select\\Account\\PrimaryFilters\\Active"
}
}
Code:
{
"filterList": [
{
"name": "active"
}
]
}
Code:
{
"presetFilters": {
"active": "active"
}
}

Comment