The Element Details tab of the Data Set Editor provides options that allow you to specify which records to include in the deployment.
To specify record selection criteria:
- From the Data Set Editor, in Tabs view, click the Element Details tab.
- Expand the Record Selection Criteria section.
- Populate the options you desire to enable.
- Query Filter – Specifies an optional SOQL query WHERE clause of up to 950 characters that determines which source data records to copy during deployment.
- Use this field to seed test data or copy a subset of relevant data between orgs, especially for partial sandboxes where memory limitations prohibit copying large amounts of data.
- Be aware of these rules for this field:
- Specify only the notation after the WHERE clause. That is, do not enter WHERE in the field.
- Do not include LIMIT clauses when also using Record Selection Limit.
- Do not include relationship field queries (Parent_Object__r.Field_Name__c). Instead, create a formula field to pull the value into the object itself.
- The Salesforce bulk API does not support some query filters, such as foreign key relationships. Refer to Bulk API Limits in the Salesforce bulk API documentation for more information.
- Ensure you understand the implications of restricting the results of data sets, especially for schemas with complex relationships. For example, a missing object record that is a required parent or master for some other record might result in errors during deployment.
- Record Selection Limit – Specifies the maximum number of records to deploy. Leave blank to deploy all records.
- By default, Release ignores the filter constraints and deploys records that are required because of related lookups even when the records don’t meet the query filter criteria. Refer to Ignore Relationship Constraint for more information.