A very common problem in Salesforce implementations is duplicate data. While training users to search for existing records before creating can help, this relies on users remembering to follow the process, which can be especially problematic if some users create records on an infrequent basis.
In this recipe, we will create a Visualforce page that overrides the lead sObject create button and requires a user to search for existing matching records before they are allowed to create a new record. In order to avoid the user having to rekey data in the event that no matches are found, the search criteria is carried through to the create page.
This recipe makes use of a controller extension, so this must be created before the Visualforce page.