Is there any way to remove the optional filter in lookup fields in lightning as we have in classic?
Best Answer
I think the people above have not well read your question. Indeed what you are asking is not supported in Lightning:
Admin-Defined Related and Dependent Lookup Filters Can’t Be Made Optional Once added, all lookup filters are required, even if admins
specify them as optional in Setup. There’s no Show all results view
for users. User-defined lookup filter fields aren’t supported.
If you are entering the Account Name in the Contact Name lookup it won't return any results, unless there is a coincidental match of your search string on a Contact Name.
When it is a required filter your search results will be limited to those that match search string and the filter. If it is an optional filter it will initially restrict the results to those that match the search string and the filter, but will give you an opportunity to show all that match the search string, disregarding the filter.
You can add help text to the lookup window, from the filter configuration page, to explain to the user that they still need to search, so there is less of a chance for confusion. I could definitely see a scenario where the user clicks the lookup and thinks that the recently viewed list is the actual total list, if they are less familiar with Salesforce.
Best Answer
I think the people above have not well read your question. Indeed what you are asking is not supported in Lightning:
https://help.salesforce.com/articleView?id=lex_gaps_limitations_search.htm&type=5