---
schema_version: "1"
id: ab27ac4bec1abad3961900a8c9a3d18869ca16cc4253a936f70acf9b64279458
title: WITH DivisionFilter
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-soql-sosl/guides/soql-sosl/sforce-api-calls-sosl-with.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-soql-sosl/guide/sforce-api-calls-sosl-with.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1ec2e54eb7a8aa265fec27e92f32dd9e1f0ef826e61f98e9fa11fbc7d9af5e63
products:
  - SOQL and SOSL Reference
  - Platform Developer Content
---

# WITH DivisionFilter

`WITH DivisionFilter` is an optional clause that can be added to a SOSL query to filter all search results based on the division field. It pre-filters all records based on the division before applying other filters. You can also specify a division by its name rather than by its ID.

For example:

```soql
FIND {test} RETURNING Account (id where name like '%test%'),
                      Contact (id where name like '%test%')
            WITH DIVISION = 'Global'
```

**note:** - Users can perform searches based on division regardless of whether they have the “Affected by Divisions” permission enabled.
- All searches within a specific division also include the global division. For example, if you search within a division called Western Division, your results include records found in both the Western Division and the global division.
