O'Reilly logo

Visualforce Development Cookbook by Keir Bowden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Preventing duplicates by searching before creating

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.

Getting ready

This recipe makes use of a controller extension, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required