Roll-Up Summary fields are only available on Master-Detail relationships. Salesforce limits them to master-detail because rollups depend on the parent owning sharing and lifecycle of the child — semantics that lookup doesn't guarantee.
If you have a lookup and need a rollup, you have several options:
- Convert lookup to master-detail. Possible only if every child record has a non-null parent (otherwise the conversion fails). You also accept the master-detail constraints — child loses owner, sharing inherits, cascade delete.
- Declarative Lookup Rollup Summaries (DLRS) — an open-source unmanaged package that builds rollups on lookup relationships using scheduled jobs and triggers under the hood. Reliable for most use cases, well-known, but adds a dependency.
- Apex trigger — write a trigger that recalculates the parent's summary field when child records change. Most flexible, but it's code; needs tests and bulk safety. Don't write a trigger in a loop with SOQL inside.
- Record-Triggered Flow on the child object — recalculate the parent's summary in a Flow when child records change. Easier to maintain than Apex but be cautious with scale (governor limits, recursion).
- Reports — sometimes the rollup is only needed for reporting. A report grouped by parent can do the math without storing it on the record. Skip the rollup entirely.
In practice: convert to master-detail if the schema supports it; otherwise use DLRS or Flow for declarative orgs and Apex for code-friendly orgs.
