Skip to main content
10 votes
Accepted

Roll-up summary field - limit on the records to be summarised

Technically speaking, no, there is not a limit I am aware of on the number of records that can be part of a roll-up summary. Practically speaking, however, there is a limit. There may be more than a ...
Derek F's user avatar
  • 62.3k
9 votes
Accepted

How to differ between rollup-summary and formula fields using APEX Schema functions?

You can tell because when you describe a Rollup Summary Field, its describe returns null when you call getCalculatedFormula(), unlike a Formula Field. system.assertEquals(null, rollupDescribe....
Adrian Larson's user avatar
  • 150k
8 votes

Subquery aggregation

The error message makes it pretty clear: only root queries support aggregate expressions So no, you can't use aggregate queries in a join. I used a different query to get the error message, since ...
Adrian Larson's user avatar
  • 150k
7 votes
Accepted

How are Roll-Up Summary fields calculated in the database?

Don't hold your breath waiting on Salesforce support :) According to the Salesforce documentation: Calculating roll-up summary field values can take up to 30 minutes, depending on the number of ...
vscuorzo's user avatar
  • 165
7 votes
Accepted

Do Roll-Up Summaries ALWAYS Cause Trigger Execution?

I created this setup in a Scratch Org using a Count Rollup Summary (with filters). In this case, I wanted a Count of Won Opportunities (Won equals true). I created a trigger that would cause a failed ...
sfdcfox's user avatar
  • 495k
6 votes
Accepted

Roll-up Summary FIeld is not calculated on after insert trigger

According to Trigger order or execution. Execute after trigger If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up ...
Santanu Boral's user avatar
6 votes
Accepted

Prevent New Child Record without triggers

If you are creating child record from parent record's detail page then create a recordtype on the parent object and create a separate page layout where you can remove the New button of Child object's ...
Santanu Boral's user avatar
6 votes
Accepted

How to roll-up Custom Object field values onto Standard Campaign Object?

Declarative Lookup Rollup Summaries is your friend any time you're seeking to roll up information that's any of Not aggregated under a Master-Detail relationship Requires filtering more complex than ...
David Reed's user avatar
  • 93.2k
6 votes
Accepted

FOR Loop NOT being executed w/ NO errors

Because you're querying against Id with a Set of Ids of the wrong object. The query result is empty, so the for loop does not execute - it has nothing to iterate over. parentIds contains Opportunity ...
David Reed's user avatar
  • 93.2k
6 votes

Roll up summary using apex code

You probably shouldn't try this yourself unless you know what you're doing (or are specifically trying to learn) If your two objects have a master-detail relationship, then you shouldn't be doing this ...
Derek F's user avatar
  • 62.3k
5 votes
Accepted

A way to disable rollup summary field

I don't know if there's a straightforward way to do that. But you could add a filter, so it won't calculate the new data. And then edit the field again and have it mass calculate everything
Fernando Gavinho's user avatar
5 votes
Accepted

Roll-up summary OR workflow

The pros and cons list for rollup summary vs trigger is pretty short. In fact, you've taken care of most of the pros and cons of using a rollup summary in your question. Rollup Summary: Pros: ...
Derek F's user avatar
  • 62.3k
5 votes
Accepted

Limitations for Lookup Summary techniques?

If you do not need "Real Time" updates your best solution would be to use a batch process to cycle through the parent records individually and summarizing the children. When you attempt to do it with ...
Eric's user avatar
  • 54.2k
5 votes

Subquery aggregation

Aggregates are not allowed in sub-queries. Instead, you can aggregate the child records. Note that parents with no children will not include a row in the results. Map<Id, AggregateResult> ...
sfdcfox's user avatar
  • 495k
5 votes
Accepted

Why aren't roll up summary fields allowed for Lookup Relationships?

Roll-Up Summary even though looks like a config for us, its very very CPU and resource intensive for Salesforce. Whenever a child record changes SF has to update the parent after running big sum of ...
Pranay Jaiswal's user avatar
5 votes
Accepted

A formula number field can't be used in rollup summary

Formula fields can only be used in a rollup summary if they are idempotent (in other words, if they return the same value every time when the record is not edited). This means you can't use cross-...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

Can I get roll-up summary field without a master-detail relationship

Yes, quite simply, you should install declarative-lookup-rollup-summaries. Then you can create a Lookup Rollup Summary to implement this functionality.
Adrian Larson's user avatar
  • 150k
4 votes

How to count the number of children accounts a Parent account has

I recommend declarative-lookup-rollup-summaries. It's free and easy to use. Clicks not code! Once you install the package, create the following Lookup Rollup Summary record: Parent Object: Account ...
Adrian Larson's user avatar
  • 150k
4 votes
Accepted

How to get 'Roll up summary field' in "Master Detail Relationship" on 'Detail page' using Formula?

I just created a formula field on a child object which takes value from Roll-up summary field of Parent. So yes it is possible. My Rollup summary and formula fields are of following type: Rollup ...
Mr.Frodo's user avatar
  • 5,802
4 votes
Accepted

How to use Rolllup summary field when there are two child objects with one master

You should be able to create 2 separate rollups then use a formula to add them together to get your total. Rollup 1: Class_Estimated_Value__c Rollup 2: Product_Estimated_Value__c Formula: ...
Jenny B's user avatar
  • 10.5k
4 votes
Accepted

roll up summary field on account related to opportunity

This feature was delivered in Spring 08 based on this Idea: Roll-up Summary Fields for Account - Opportunity Standard Relationship The recently announced Winter 08 feature - Roll-up Summary Fields ...
Adrian Larson's user avatar
  • 150k
4 votes
Accepted

APEX Unit Test - test data with roll-up totals not as expected

Objects are normally related via Id values not references so one change to make is to replace this: opportunity.Campaign = campaign; with this: opportunity.CampaignId = campaign.Id; so the ...
Keith C's user avatar
  • 136k
4 votes
Accepted

How to handle Roll Up Summary type Calculations WITHOUT using Master-Detail

The standard go-to answer is to use Andrew Fawcett's excellent Declarative Rollup Summary package. There's a managed package install link, and it comes complete with a UI for configuring your desired ...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

Rollup Helper Tool priority

Rollup helper tool generates a Trigger, and I assume you also have your logic in a separate trigger. Quoting from documentation: The order of execution isn’t guaranteed when having multiple triggers ...
Raul's user avatar
  • 18.8k
4 votes
Accepted

Recalculate percentage of roll up summary field with process builder when a new record is added

I think you just need a different Process. Going to the Order of Execution, it looks like what happens is this: You have an Object A with Total = 30, deriving from two Object Bs with Amounts of 10 ...
David Reed's user avatar
  • 93.2k
4 votes
Accepted

Is it possible to roll-up summarize child records based on a lookup field?

From Salesforce documentation: You can’t use long text area, multi-select picklist, Description fields, system fields like Last Activity, cross-object formula fields, and lookup fields in the ...
Pranay Jaiswal's user avatar
4 votes

Why aren't roll up summary fields allowed for Lookup Relationships?

Please share if there is a valid reason why they're only available for master-detail relationships. It's by design, and how/why Salesforce decided to do it that way is abstracted. If you are looking ...
Jayant Das's user avatar
  • 30.6k
4 votes
Accepted

Rollup Summary field is deleted, but the dependency still exist

When you clicked on the delete link, you would have seen this pop-up message: After you've deleted this field, it appears in the deleted components list for 15 days. During that time, you can ...
Hengky Djapar's user avatar
4 votes
Accepted

How can I select "AccountTeamMember" in the Summarized Object in create field?

The relationship between Account Team Member and Account is a Lookup, and is not eligible for rollups. Because this is a standard object, you cannot make it a master-detail child of another object, so ...
David Reed's user avatar
  • 93.2k

Only top scored, non community-wiki answers of a minimum length are eligible