When lead is converted (to contact/account) & the converted flag is set to true, how do I use this flag to remove the lead record from search results? I only want the users to be able to see the contact/account via global search
Hi Laura Dolphin
It can be done by extending some specific endPoints, specifically the GET /globalsearch and GET /<module>.
By extending these endPoints you can, eventually, force an additional filter, exactly as you want to apply.
Hi Andre - I've tried doing this, and can successfully override the composeFilters function in a custom GlobalSearchApi.php file. I can remove all leads by using:
$termsFilter = new \Elastica\Filter\Terms("_type", array("Leads"));$boolFilter = new \Elastica\Filter\BoolFilter();$boolFilter->addMustNot($tagFilter);$this->filters = $boolFilter;
But I'm uncertain of how to add other criteria to filter Leads ... e.g. only filter Leads whose status is abc, etc. Can you help with this?
Take a look at the file src/Elasticsearch/Provider/Visibility/Filter/KBStatusFilter.php, it can give you some insight.
I understand how to use the terms filter to filter by status. The trouble I'm having is filtering by status and leads. I can use the boolean filter addMustNot to get "Leads OR status=1" but not "Leads AND status=1".
In case anyone is interested in the solution - I used a work around - a custom field was created (unique to Leads) with the string value of status, and I filtered by that.
Retrieving data ...