# Duplicate prevention and checks at entry

The **Prevent** section of the **Tomba Data Quality** tab stops bad data as records are saved: duplicates of Leads,
Contacts and Accounts, and badly formatted values. Everything is off when you install Tomba. The checks use no Tomba
credits; verifying new emails does, as it always has.

## Before you start

- You need the **Tomba Admin** permission set, and Tomba must be connected to a Tomba Enterprise account.
- Prevention applies to everyone who saves Leads, Contacts and Accounts, with or without a Tomba permission set: in
  Salesforce, with the Data Import Wizard, Data Loader, the APIs, web-to-lead, Flow and integrations.
- To exempt an integration user, give them the **Tomba: Bypass Prevention** custom permission in a permission set of
  your own. No Tomba permission set includes it.

## Duplicate prevention

Open **Tomba Data Quality › Prevent › Duplicate prevention** and choose, for Leads, Contacts and Accounts:

| Setting                  | What happens when a duplicate is saved                                                                                                               |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Off                      | Nothing (the default).                                                                                                                               |
| Flag possible duplicates | The record is saved with **Tomba Duplicate Status** set to **Possible duplicate** and **Tomba Duplicate Of** set to the record it duplicates.        |
| Block in the app         | People saving a record page in Salesforce see a message that names the existing record. Imports, Data Loader, the APIs and integrations are flagged. |
| Block every save         | Every save of a duplicate is refused, imports and integrations included.                                                                             |

Tomba compares the record with the rules of [Clean](/salesforce/clean-data): the same email for Leads and Contacts,
the same person at an Account for Contacts, and the same domain or name for Accounts. It checks new records and records
whose email, name, Account or website changed. Users match only the records they can see.

- A Lead whose email belongs to a Contact is never blocked: Tomba fills **Tomba Existing Contact**, so you can convert
  the Lead into that Contact from [Clean](/salesforce/clean-data) or the record page.
- Records saved together are compared with each other too. Data Loader and the Bulk API load in parallel batches that
  can't see each other: the next duplicate search finds what they let through.
- When Salesforce limits are close (a very large save), Tomba skips the check and sets the status to **Unchecked**. The
  next duplicate search covers those records.
- Converted Leads and records merged in Clean are never checked.

### Notifications and review

- With **Notify the person who saved a possible duplicate** on, someone who saves a flagged record in Salesforce gets a
  bell notification that opens it. The **Tomba Insights** component on the record shows the duplicate.
- Once a day, the records flagged since the day before become duplicate groups in **Clean › Duplicates**, with the
  source **At entry**, for you to merge or dismiss. **Not duplicates** sets the status to **Not a duplicate**, and a
  merge clears it on the record kept.
- The **Leads Flagged as Possible Duplicates** report in the Tomba Reports folder lists flagged and unchecked Leads.

If your org also has active Salesforce duplicate rules, the page lists them: turn off the ones that check the same
thing, so people aren't warned or blocked twice.

## Validate at entry

Open **Tomba Data Quality › Prevent › Validate at entry**. Tomba checks the fields that are new or changed when a Lead,
Contact or Account is saved.

**Fix when saved** saves the standard value instead, without a message:

- names in all caps or all lower case (Leads and Contacts);
- extra spaces;
- websites with capitals or a trailing slash;
- countries and states in another spelling (`Deutschland`, `usa`), saved as their name. With State and
  Country/Territory Picklists on, Salesforce already keeps them standard.

**Block when saved in the app** refuses a phone that isn't a phone number, or a website that isn't a website, with a
message on the field. Only people saving a record page in Salesforce see it: imports and integrations are never refused
for a format.

### Emails found undeliverable

Email deliverability is checked after the save, by [automation](/salesforce/automation) (**Verify changed emails**).
With **Notify owners when an email is found invalid or disposable** on, the owner of a record whose email the
automation finds invalid or disposable gets a bell notification that opens the record. Verifying uses verification
credits.

## Credits and limits

- Duplicate prevention, the fixes and the blocks use no Tomba credits.
- Each save runs at most one query per duplicate rule, only for the records whose matched fields changed.
- Bell notifications: at most 10 per save and 10 per automation run.
