Notice: The below question does not address the issue we were trying to solve. The real issue had to do with a Visualforce component (see the update). Jenny B's answer provides good information for anyone seeing similar issues with standard Page Layouts. A question about this issue occuring in Visualforce can be found here.
Requirement
In our Salesforce Org, Accounts have 2 record types: Investor and Lender and Opportunities have 2 correlated record types: Equity and Debt.
We have the following business requirement: The Account on an Opportunity must be of type Investor for Opportunities of type Equity and must be of type Lender for Opportunities of type Debt.
Of course, we could use a validation rule to enforce this, but a Lookup Filter would be best as users should only be presented valid Accounts for the Opportunity.
Lookup Filter
The lookup filter we are using has the following criteria:
Opportunity: Opportunity Record Type
equalsEquity
Account Name: Account Record Type
equalsInvestor
Opportunity: Opportunity Record Type
equalsDebt
Account Name: Account Record Type
equalsLender
With filter logic of (1 AND 2) OR (3 AND 4)
.
The Issue
If the Opportunity is created from the Account, the Account lookup field is filled automatically and the lookup filter criteria correctly enforce the business requirement.
However, if the user attempts to lookup an Account manually from the New Opportunity page, no search results are displayed in the lookup dialogue. (See update)
How can this requirement be enforced in a lookup filter that correctly displays search results to the user?
Update
I was wrong about the source of this issue. On the standard Account page layout, the lookup filter works correctly. The real issue lies in a Visualforce page we are using to lookup the Account.
<apex:inputField value="{!Opportunity.AccountId}" required="true"/>
For some reason, the lookup to AccountId
does not function the same as the standard Account lookup. A question about this issue can be found here.