Ability to add and customize default filters for all users via GUI. As the DB grows it takes longer and longer to load a page/entity such as accounts and or opportunities because the default is to show all items within that entity. Currently in my db as an example is takes 4 sec for the accounts screen to show any items. If I add a filter manually for example the last 30 days it takes less than 1 sec to display and move on.
Ability to adjust default filter under any entity
Collapse
X
-
Hi,
add here (in your instance) https://github.com/espocrm/espocrm/b.../Base.php#L263
if ($entityType == "{YourEntityName}") {$GLOBALS['log']->error($sql);}
After go to list view. then remove added row.
Now you can check the sql, built for getting the list. Do you see, how to optimize the query?Comment
-
Hi Khopper, 3 s comes for 11k records sounds unviably slow (we haven’t load tested yet). I was viewing a Espo as speed orientated but we have more accounts than that on our 10 year old sugar system and it loads in sub 300ms.
What server spec are you using? CPU, RAM, SSD? Are you apache or Ngnix?
olof.
Comment
-
It's just the Accounts List. I have it limited to display the first 30 records but it does give you count of all records in the DB.
Everywhere else it is is no problem. I have been considering upgrading my equipment to SSD's
VMware ESXi Host - Dell PowerEdge R710, 2 - Xeon L5520 2.27 GHz, 64GB RAM, 6 - 1TB 7200 RPM Drives in Raid 5, 4-Port 1GB
VM Specs -1 CPU - 4 cores, 4 GB RAM, 500 GB HDD, 1GB NIC
Ubuntu LTS 14.04, Apache2, MySQL 5.6Last edited by khopper; 07-22-2018, 02:29 PM.
-
-
Here is a screen shot of the load time using the developer tools in chrome.
No Filters, all I did was a refresh on the Accounts Screen.
I even dropped it to showing the first 20 records from what it was at 30 records.
This was with only 1 user logged into the system being myself.
2 PhotosLast edited by khopper; 07-22-2018, 04:28 PM.Comment
-
Did this feature ever arrive? I haven't seen it. I have an Entity called Staff of which there are currently 50 records. 9 are Inactive and so I never need to see the record, but don't want to delete them for obvious reasons. It would be great if I could set my Staff Entity to auto filter Active staff.Comment
-
beeline,
If you work mainly from one browser (not from an incognito tab), then the filters that you set in your entity in Administration > Entity Manager > Your_Entity_Name > Layouts > Search Filters are enabled, then the filter you set is saved until you clear the browser cache.
However, Report Filters may be more suitable for you:
Comment
-
hey victor,
is there anyway to force a list view to be loaded with a preselect filter, e.g accounts when the list view is loaded by default it should load (Recently Created) instead of All.
when selecting a link we could apply a getSelectPrimaryFilter or getSelectBooleanFilter to load the select-modal with predefined filter like here https://github.com/espocrm/espocrm/b...ed-user.js#L49
but when i looked into the code base for the list view i couldn't find anything that allow such ability. i am missing something or is this not possible now ?
Thanks -
rabii, I think, this is answer https://forum.espocrm.com/forum/gene...7196#post47196 -
i have tried it but didn't work, can you try it your end and let me know if it works, i have tried all variations as below and none of them worked:
tried this at first and didn't work:
"defaultFilterData":{
"primary":"recentlyCreated"
},
Also tried and didn't work
"defaultFilterData":{
"name":"recentlyCreated"
},
and tried this also didn't work
"defaultFilterData":{
"filter":"recentlyCreated"
},
Tried this for the account entity hence recentlyCreated is a primary filter.
-
-
Hi rabii,
I added the following to the custom/Espo/Custom/Resources/metadata/clientDefs/Account.json file:
"defaultFilterData": {
"primary": "recentlyCreated"
}
Everything worked fine for me after making rebuild and page refreshing. Please try one more time and let me know.
For the best effect, try to test if the changes worked by going to the anonymous tab and logging into your instance as any user that has access to Accounts.Last edited by lazovic; 05-19-2023, 10:59 AM.Comment
-
rabii,
After clearing the browser cache, everything will work for the administrator too in the general (non-anonymous) tabs.
Personally, I used a regular browser and an incognito tab. I updated the page, made Rebuild, made Rebuild Report Filters (because I set the Report Filter as the default).
My mistake was that I cached both the regular browser and the anonymous tab, although I thought I had eliminated this factor.
And if anyone is interested in how to set the Report Filter as the default filter:
1. I created the filters I need in Administration > Report Filters and after creating them, made Rebuild and made Rebuild Report Filters (screenshot 1).
2. As a result /var/www/html/your_instance_name/custom/Espo/Custom/Resources/metadata/clientDefs/Account.json had the following form:
Code:{ "filterList": [ "__APPEND__", { "isReportFilter": true, "name": "reportFilter64668835517b215b5" }, { "isReportFilter": true, "name": "reportFilter646686b2ed452e575" } ] }
3. Note that the name of your filter will be different from what you see in the UI. However, it is easy to find by ID. Actually in our Account.json the name of our filter consists of reportFilter and ID. I put the following in /var/www/html/your_instance_name/custom/Espo/Custom/Resources/metadata/clientDefs/Account.json:
Code:{ "defaultFilterData": { "primary": "reportFilter64668835517b215b5" } }
4. Step 3 made it impossible to select another one of my custom Report Filters that I needed. Therefore, I made Rebuild and made Rebuild Report Filters again, although I could insert immediately (both options are suitable):
Code:{ "defaultFilterData": { "primary": "reportFilter64668835517b215b5" }, "filterList": [ "__APPEND__", { "isReportFilter": true, "name": "reportFilter64668835517b215b5" }, { "isReportFilter": true, "name": "reportFilter646686b2ed452e575" } ] }
5. Final result on screenshot 2.Last edited by victor; 05-19-2023, 01:12 PM.Comment
-
Hello victor,
When I am creating an Opportunity from an Account, only the related Contacts are shown (see Screenshot 1). Similarly, I have a custom entity called Dealer. When I create an Opportunity there, the Contact-related filter should also apply, but instead, it is showing all contacts. Could you please help me implement this filter for the custom entity I created?1 PhotoComment
-
A similar request was considered on the forum. You may find it useful: https://forum.espocrm.com/forum/deve...current-record.
-
Comment