feat: add record limit to update records - #1988
Conversation
There was a problem hiding this comment.
Pull request overview
Adds per-object record windowing to the “Update Records Without a File” flow so large data volumes can be processed incrementally, with validation, preview/download, and the actual update operating on the same SOQL-scoped record set (closes #1030).
Changes:
- Introduces optional per-object SOQL
LIMITandOFFSET, including UI inputs and validation. - Refactors record fetching so validation preview/download and deployment share the same query path (including mixed custom criteria handling).
- Records limit/offset in data-history entries and surfaces them in deployment status messaging and history config display.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libs/shared/ui-core/src/mass-update-records/useDeployRecords.ts | Plumbs limit/offset into history capture and analytics flags for submissions. |
| libs/shared/ui-core/src/mass-update-records/MassUpdateRecordsObjectRowLimit.tsx | New UI component for per-object limit/offset inputs with inline validation messaging. |
| libs/shared/ui-core/src/mass-update-records/MassUpdateRecordsObjectRow.tsx | Uses shared query path for “Download Records” preview and conditionally renders limit/offset controls. |
| libs/shared/ui-core/src/mass-update-records/MassUpdateRecordsDeploymentRow.tsx | Displays effective limit/offset context before processing starts. |
| libs/shared/ui-core/src/mass-update-records/mass-update-records.utils.tsx | Implements limit/offset normalization, query composition, and windowed querying for mixed criteria. |
| libs/shared/ui-core/src/mass-update-records/mass-update-records.types.tsx | Extends MetadataRow with optional limit/offset and adds a shared RecordLimitAndOffset type. |
| libs/shared/ui-core/src/mass-update-records/data-history-capture.ts | Captures limit/offset into data-history config for accurate historical context. |
| libs/shared/ui-core/src/mass-update-records/tests/MassUpdateRecordsObjectRowLimit.spec.tsx | Adds unit tests for the new limit/offset input component behavior and errors. |
| libs/shared/ui-core/src/mass-update-records/tests/mass-update-records.utils.spec.ts | Adds extensive tests for query composition and windowed querying semantics with limit/offset. |
| libs/shared/ui-core/src/index.ts | Exports the new MassUpdateRecordsObjectRowLimit component from the ui-core barrel. |
| libs/features/update-records/src/selection/useMassUpdateFieldItems.ts | Adds state + reducer action to store per-object limit/offset and invalidate prior validation results when changed. |
| libs/features/update-records/src/selection/MassUpdateRecordsSelection.tsx | Wires handleRecordLimitChange through selection-level component tree. |
| libs/features/update-records/src/selection/MassUpdateRecordsObjects.tsx | Threads limit/offset change handler down to per-object components. |
| libs/features/update-records/src/selection/MassUpdateRecordsObject.tsx | Passes row limit/offset into MassUpdateRecordsObjectRow and dispatches updates upward. |
| libs/features/update-records/src/deployment/MassUpdateRecordsDeployment.tsx | Passes limit/offset into deployment row rendering for user visibility. |
| libs/features/data-history/src/lib/data-history-page.utils.ts | Adds display fields for recordLimit/recordOffset in history config UI. |
| apps/docs/docs/load/update-records.mdx | Documents the new limit/offset behavior, constraints, and suggested chunking workflow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6b80a6f to
5d5bafc
Compare
Code review summaryAutomated review (Claude Code). Fixes below are pushed as an amend to the PR head. Verdict: careful, well-tested feature whose LIMIT path is correct — but OFFSET is silently truncated by Salesforce, so the validated count over-promises what actually gets updated.
|
5d5bafc to
6fdd10e
Compare
Updating records without a file had no way to work on a subset of an object. Every matching record is queried into the browser before anything is submitted, so a user with 9M records could not use the tool at all. Each object now takes an optional maximum number of records to update, which lets a large data volume be worked through a chunk at a time by pairing it with criteria that stop matching once a record is updated (e.g. Only if blank) and re-running. The limit is applied to the SOQL rather than filtering client side, so the validated impacted record count, the Download Records button and the update itself all see the identical set. An OFFSET was considered but Salesforce caps it at 2,000, which makes it useless for the data volumes this is meant for. Closes #1030
6fdd10e to
9be1d59
Compare
Updating records without a file had no way to work on a subset of an object. Every matching record is queried into the browser before anything is submitted, so a user with 9M records could not use the tool at all.
Each object now takes an optional maximum number of records to update, which lets a large data volume be worked through a chunk at a time by pairing it with criteria that stop matching once a record is updated (e.g. Only if blank) and re-running. The limit is applied to the SOQL rather than filtering client side, so the validated impacted record count, the Download Records button and the update itself all see the identical set.
An
OFFSET/ skip-records option was considered but Salesforce caps it at 2,000, which makes it useless for the data volumes this is meant for.Closes #1030