roll-up-summary-alternatives
Use when native Roll-Up Summary fields are not enough and the design needs Flow, Apex aggregate, or DLRS-style alternatives for lookup or advanced summary scenarios. Triggers: 'roll up summary on lookup', 'DLRS', 'aggregate trigger', 'summary count on parent', 'roll-up limitation'. NOT for ordinary master-detail roll-up fields that fit native limits without extra design tradeoffs.
Best use case
roll-up-summary-alternatives is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when native Roll-Up Summary fields are not enough and the design needs Flow, Apex aggregate, or DLRS-style alternatives for lookup or advanced summary scenarios. Triggers: 'roll up summary on lookup', 'DLRS', 'aggregate trigger', 'summary count on parent', 'roll-up limitation'. NOT for ordinary master-detail roll-up fields that fit native limits without extra design tradeoffs.
Teams using roll-up-summary-alternatives should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/roll-up-summary-alternatives/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How roll-up-summary-alternatives Compares
| Feature / Agent | roll-up-summary-alternatives | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when native Roll-Up Summary fields are not enough and the design needs Flow, Apex aggregate, or DLRS-style alternatives for lookup or advanced summary scenarios. Triggers: 'roll up summary on lookup', 'DLRS', 'aggregate trigger', 'summary count on parent', 'roll-up limitation'. NOT for ordinary master-detail roll-up fields that fit native limits without extra design tradeoffs.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Roll Up Summary Alternatives Use this skill when stakeholders say "just add a roll-up field" and the platform answer is "not natively, at least not that way." Native Roll-Up Summary fields are excellent when the relationship and limits fit, but many orgs need lookup-based summaries, filtered calculations, or higher-volume behavior that changes the right implementation choice. --- ## Before Starting Gather this context before working on anything in this domain: - Is the relationship master-detail or lookup? - Does the summary need real-time accuracy, near-real-time, or just eventual consistency? - Is the org comfortable with code, managed or open-source tooling, or declarative-only approaches? --- ## Core Concepts ### Native Roll-Up Summary Is The First Choice If the relationship is master-detail and the supported summary behavior meets the requirement, keep it native. Native summary fields are easier to operate than custom recalculation logic. ### Lookup Rollups Need An Alternative Pattern Once the relationship is lookup, teams move into tradeoff territory. Flow, Apex aggregate logic, or a tool such as Declarative Lookup Rollup Summaries can solve the gap, but they differ in scale, maintainability, and operational visibility. ### Volume And Recalculation Style Matter Low-volume event-driven updates are different from large data backfills or high-churn parent-child relationships. The implementation needs to match both normal traffic and recalculation scenarios. ### Summary Logic Is Data Architecture Every rollup decision affects locking, recursion, reporting, and user trust in totals. A "simple counter field" can still become a reliability problem if the design ignores bulk behavior. --- ## Common Patterns ### Native Roll-Up Summary Field **When to use:** Master-detail relationship and supported summary logic. **How it works:** Use the platform feature and avoid custom recalculation paths. **Why not the alternative:** Custom logic adds maintenance cost with no benefit when native fit is available. ### Flow-Maintained Summary **When to use:** Lookup relationship, moderate volume, and declarative ownership is preferred. **How it works:** Record-triggered automation recalculates or adjusts a parent summary field with clear bulk and fault handling. ### Apex Aggregate Rollup **When to use:** High-volume or complex filtered summaries need stronger control and testing. **How it works:** Collect affected parent IDs, run aggregate SOQL once, and update parent records in bulk. --- ## Decision Guidance | Situation | Recommended Approach | Reason | |---|---|---| | Master-detail and native summary fits | Native roll-up summary | Lowest maintenance and strongest platform fit | | Lookup relationship with moderate volume | Flow or DLRS-style approach | Declarative option may be sufficient | | Complex filter logic or higher volume | Apex aggregate pattern | Better control over recalculation and scale | | Team wants no-code but needs lookup summaries at scale | Re-evaluate operational ownership carefully | Tooling convenience does not remove recalculation complexity | --- ## Recommended Workflow Step-by-step instructions for an AI agent or practitioner activating this skill: 1. Gather context — confirm the org edition, relevant objects, and current configuration state 2. Review official sources — check the references in this skill's well-architected.md before making changes 3. Implement or advise — apply the patterns from Core Concepts and Common Patterns sections above 4. Validate — run the skill's checker script and verify against the Review Checklist below 5. Document — record any deviations from standard patterns and update the template if needed --- ## Review Checklist Run through these before marking work in this area complete: - [ ] Native roll-up summary was rejected for a real reason, not habit. - [ ] Lookup versus master-detail constraints are explicit. - [ ] Recalculation path is bulk-safe and tested for backfill scenarios. - [ ] Parent locking and recursion risk were considered. - [ ] Reporting expectations match the chosen summary model. - [ ] The org has an owner for maintenance and re-sync operations. --- ## Salesforce-Specific Gotchas Non-obvious platform behaviors that cause real production problems: 1. **Lookup rollups are not a free native feature** - once the relationship is not master-detail, you own more tradeoffs. 2. **Backfills expose weak designs** - a pattern that works per record can fail badly during migration or data cleanup. 3. **Parent locking can become the bottleneck** - summary updates concentrate writes on the same parent records. 4. **A declarative option still has operating cost** - someone must own failures, recalcs, and drift correction. --- ## Output Artifacts | Artifact | Description | |---|---| | Summary decision | Recommendation for native, Flow, Apex, or DLRS-style pattern | | Rollup review | Findings on scale, locking, and recalculation risk | | Bulk recalculation pattern | Aggregate-based implementation guidance for parent totals | --- ## Related Skills - `apex/trigger-framework` - use when the rollup implementation is becoming trigger-architecture work. - `apex/recursive-trigger-prevention` - use when parent-summary writes are causing re-entry problems. - `data/multi-currency-and-advanced-currency-management` - use when the rollup requirement depends on currency conversion behavior.
Related Skills
flow-rollback-patterns
Use the Flow Rollback Records element to undo DML inside the current transaction. Covers when rollback is appropriate vs catastrophic, how to combine with fault paths, partial-commit pitfalls, and the interaction with publish-after-commit Platform Events. NOT for external-system rollback (use compensation patterns). NOT for Database.SavePoint in Apex (use apex-transaction-control).
flow-batch-processing-alternatives
Use when a Scheduled Flow or Record-Triggered Flow needs to process more records than Flow can safely handle in a single run. Covers Flow limit realities, scheduled-path chunking, Data Cloud batch transforms, and Apex Queueable/Batch escalation. Does NOT cover choosing async across a general workflow (see async-selection decision tree).
rollback-and-hotfix-strategy
Planning and executing metadata rollbacks and emergency hotfixes in Salesforce orgs. Use when a production deployment causes regression and needs to be reverted, or when an urgent fix must bypass the normal release pipeline. Covers pre-deploy archive bundles, quick deploy for hotfixes, non-rollbackable component handling, and hotfix branch isolation. NOT for routine CI/CD pipeline setup (use continuous-integration-testing). NOT for destructive changes authoring (use destructive-changes-deployment).
npsp-custom-rollups
Use this skill when configuring, troubleshooting, or extending NPSP Customizable Rollups (CRLP) — including rollup definitions, filter groups, batch job modes, and the one-way migration from legacy NPSP rollups. Trigger keywords: CRLP, customizable rollups, rollup definition, filter group, rollup batch job, NPSP gift totals, NPSP recalculate rollups. NOT for standard Salesforce roll-up summary fields, Nonprofit Cloud (NPC) native aggregation, or Rollup Helper third-party solutions.
cross-object-formula-and-rollup-performance
Use when diagnosing or preventing performance problems caused by cross-object formula spanning relationships and roll-up summary field recalculations — especially in LDV orgs. Triggers: 'roll-up summary timing stale in trigger', 'Maximum 15 object references error', 'rollup recalculation timeout on large child set'. NOT for formula syntax authoring (use admin/formula-fields), formula compile-size limits (use apex/formula-field-performance-and-limits), or general governor-limit troubleshooting.
apex-savepoint-and-rollback
Database.Savepoint / Database.rollback for partial-transaction undo: placement rules, ID reset, limit counters, nested savepoints, rollback after callout. NOT for Database.allOrNone=false partial success semantics (use apex-partial-dml). NOT for Queueable chained rollback (use apex-queueable-patterns).
sales-coach-agent-rollout
Use when an admin or RevOps team is rolling out the out-of-the-box Sales Coach agent (the Agentforce template that role-plays opportunity-stage conversations with reps for Discovery, Needs Analysis, Qualification, Proposal/Pricing, and Negotiation/Review). Covers prerequisites (Agentforce SKU, Einstein Generative AI activation, Opportunity stage hygiene, knowledge grounding), stage-by-stage prompt configuration, customizing role-play scenarios with org-specific objections and value props, privacy posture for what gets captured in LLM context vs persisted, console-vs-portal embedding choices, and a measurement plan tying coached opportunities to win-rate signal. Triggers: 'roll out sales coach agent', 'set up Agentforce sales coach for our reps', 'sales coach not engaging reps on early-stage opps', 'customize sales coach role-play scenarios for our industry', 'how do we measure sales coach effectiveness', 'sales coach feedback contradicts our methodology'. NOT for building bespoke Agentforce agents from scratch (use agentforce/agentforce-agent-design once authored), NOT for Service Coach / Service Replies (different template, use agentforce/service-coach-rollout once authored), NOT for prompt-template authoring or Prompt Builder mechanics (use agentforce/prompt-builder-template-design), NOT for Einstein Conversation Insights / call-recording analysis (separate product line).
employee-hr-service-agent-rollout
Use when an org is rolling out an Agentforce-based HR / Employee Service agent for self-service workflows like leave requests, benefits questions, onboarding tasks, and time-off balance lookups. Covers Employee Agent licensing posture, knowledge-base grounding for HR policy, integration patterns with HRIS systems of record (Workday, ADP, BambooHR) — read-only vs read-write trade-offs, employee-vs-manager visibility model, PII handling under the Einstein Trust Layer, surface-placement decision (in-Salesforce vs Slack-first vs Teams-first), and rollout measurement (deflection, first-response time, employee CSAT). Triggers: 'we want an HR self-service agent for leave and benefits', 'employees keep emailing HR for time-off balance — can Agentforce answer that?', 'roll out Employee Service agent in Slack', 'wire HRIS into our Agentforce HR bot', 'how do we handle PII when the agent reads Workday', 'measure deflection on the HR agent we just launched'. NOT for general Agentforce agent build mechanics (use agentforce/agentforce-persona-design + agentforce/custom-agent-actions-apex), NOT for the channel deployment plumbing (use agentforce/agent-channel-deployment), NOT for prompt/instruction authoring (use agentforce/agentforce-guardrails).
field-dependency-and-controlling
Dependent picklists in Salesforce: controlling field (picklist or checkbox), dependent picklist, valueSettings matrix in metadata, API behavior via SOAP/REST, LWC lightning-combobox with dependency. NOT for record types (use admin/record-types). NOT for validation rules.
xss-and-injection-prevention
Use when writing or reviewing Visualforce pages, Apex controllers, or LWC components that output user-supplied data, build dynamic queries, or construct HTTP responses. Triggers: 'XSS in Visualforce', 'SOQL injection vulnerability', 'how to encode output in Apex', 'JSENCODE Visualforce', 'open redirect prevention'. NOT for Apex CRUD/FLS enforcement (use soql-security or apex-crud-and-fls), NOT for Shield encryption (use shield-encryption-key-management), NOT for AppExchange security review process (use secure-coding-review-checklist).
visualforce-security-and-modernization
Use when hardening or modernizing legacy Visualforce pages — covers the platform CSRF token model and when disabling it is a security regression, view state encryption guarantees and the 170 KB ceiling, FLS/CRUD enforcement gaps on `<apex:outputField>` and on getters that return sObjects, `<apex:includeScript>` interaction with the org Content Security Policy, hosting LWC inside a VF page via `lightning:container` / `lightning-out`, and the retire-vs-harden-vs-leave-alone decision for an inventory of legacy pages. Triggers: 'should I rewrite this Visualforce page in LWC', 'CSRF protection disabled on Visualforce page is that safe', 'community user sees a field they should not on a Visualforce page', 'view state encryption is that enough for sensitive data', 'how do I host an LWC inside a Visualforce page', 'apex:dynamicComponent and apex:actionFunction safe to keep'. NOT for greenfield Visualforce architecture (use apex/visualforce-fundamentals — controller types, view state pattern selection, PDF rendering); NOT for Visualforce email template authoring (use apex/visualforce-email-templates if/when that skill is authored); NOT for general Apex security review across triggers and async (use apex/soql-security and security/secure-coding-review-checklist).
transaction-security-policies
Transaction Security policy creation and configuration: condition builder, enhanced policies, enforcement actions (block, MFA, notification, end session), real-time monitoring mode, and policy troubleshooting. NOT for Event Monitoring log analysis or Shield Event Monitoring setup (use event-monitoring). NOT for Apex testing or debug-log analysis.