Well it has been under development for few weekends now, but I’m finally announcing the latest release of this tool. But before I go into the details of installing it and whats in it, i want to thank everyone who has shared feedback and encouragement with me via tweets, GitHub and comments on the original post, all of which has been a huge motivation for me!
This release completes the feature set i set out in my original post as well as some bug fixes.
- New Feature: Scheduled calculation mode (alternative to the existing Realtime mode)
- New Feature: Calculate button to run a full rollup calculation on existing data
- New Feature: Developer API, for embedding calculations in existing Apex Triggers
- Bug Fix: Realtime mode, improved optimisation to monitor rollup criteria fields and re-parenting
The tool now also has its own Application in the drop down containing the original tab and a new one.
New Feature : Scheduled Calculation Mode
For those that prefer to differ the lookup calculations, perhaps for performance or governor reasons (see below), you can now choose Scheduled from the Calculation Mode field. This requires a small Apex Trigger as per the previous release, it’s super easy, no developers required, just click the Manage Child Trigger button. Then simply schedule the job using the standard Schedule Apex button under Setup then Apex Classes, the Apex Class is RollupJob.
Once this mode is enabled, you will see the new related list, Lookup Rollup Summary Schedule Items (as shown above) will fill up as child records are added, deleted or updated (only when lookup referenced fields are modified) with a list of parent records that are effectively queued up ready for the scheduled job to process. Once processed successfully they will be removed automatically.
If there are any errors (other triggers, validation rules etc preventing the master records being updated) you will see these in the new tab Lookup Rollup Summary Logs. Once you correct these you can remove the log entry or wait for the next scheduled execution and the log entry will automatically be removed for the effected parent record.
Tip: Add a Workflow Email Action to this object if you want to monitor log entries against certain objects.
New Feature: Calculation of existing Records
If you implement this tool and there are existing records in your objects, you can now use the Calculate button to start a background job to retrospectively calculate the rollups (time this accordingly to your user activity). Its also useful if your changing the rollup criteria or have deactivated and are now reactivating your rollup for some reason.
The button will start a job to select ALL of the records in the parent object (due to platform restrictions applying the child filter criteria), however the rollup criteria will still be applied as the rollups are calculated. If there are any issues during this process the above Lookup Rollup Summary Logs tab will list these errors, as with the scheduled mode, correct the errors and delete the log entries manually or rerun the calculate process.
New Feature: Developer API
If you have developers writing Apex Triggers or other Apex processes where you would like the rollups recalculated, you can have them call the Developer API. Simply select Developer from the Calculation Mode field and any lookups that are related to the child records passed into the API will be calculated automatically (the developer does not need to know or ask you for the rollups themselves, meaning you can continue to declaratively add or update them afterwards).
The main API, is the rollup method as shown below. Though there is also API’s to invoke the Calculate and Schedule jobs. The triggerHandler method is really for use by the Apex Triggers generated by the Manage Child Triggers button. Though if your in a Apex Trigger context it will work equally well from your triggers also.
List<Opportunity> opportunities = [select AccountId from Opportunity where Id in :myOpportunityIds]; List<SObject> parents = (List<SObject>) dlrs.RollupService.rollup(opportunities); update parents;
NOTE: As minimum the relationship fields must have been included in the query before passing the children to the API. Also keep in mind if you have multiple parent rollups the list of SObject’s returned will be a mix of SObject types.
Advanced Relationship Criteria Handling
As an optimisation the tool will only attempt to recalculate rollups if relevant fields (such as those in the Field to Aggregate or Relationship Field fields) have been modified by the user (or if a child record is added or deleted). In this new release if references to other fields are made in the Relationship Criteria field, such as the example shown here, you must also ensure to specify the field/s in the Relationship Criteria Fields field. So the tool can also monitor these fields as being changed by the user. In the example used in this blog it means that if the AccountId, Amount or the StageName fields are changed on the Opportunity by the user, the Account rollup will be recalculated (this applies to Realtime and Scheduled modes).
Installation and Upgrade
As before the full source code for the tool is open source and available via the GitHub project, however if you have installed via the previous managed package you can now upgrade to obtain the new features above. All installation links and release history can be found here. There are some post installation steps to enable some new components. If your installing for the first time you can skip these.
- Add the Calculate button to the layout
- Add the Relationship Criteria Fields and Calculate Job Id fields to the layout (as shown above)
- Add the Lookup Rollup Summary Schedule Items related list to the layout (as shown above, remove the New button and make Parent Id and Parent Record fields visible)
- Depending on the security options you took during install, you may need to enable the Declarative Lookup Rollup Summaries application and Lookup Rollup Summaries Logs tab on relevant profiles / permission sets.
Dealing with the 50k Aggregate Query Limit
If you hit this limit its likely due to the fact that you have a LOT of child records related to some or an average most of your parent records your rolling up on. Another reason, especially if your hitting this in Realtime mode, it maybe because you have to many rollups defined to one parent (though the tool attempts to merge rollup calculations, its not always possible). In this case switching to Scheduled mode for those effected lookups is the next thing to try.
If your already running in Scheduled mode or having a governor issue with the Calculate facility, you can try reducing the number of parent records processed at a time by these jobs. For this you will find under Custom Settings, the Declarative Rollup Summary Tool settings, the default for both the scope size settings is 100 parent records, try adjusting it downwards, the jobs may take longer (more chunks to process) as a result but they will stand a better chance of completing within the current platform query governor.
Feedback and Issues
Feedback, ideas etc via comments below most welcome, please report any issues via the GitHub issues page.
Pingback: New Tool : Declarative Rollups for Lookups! | Andy in the Cloud
February 11, 2014 at 2:49 pm
One question: Will this tool allow you to create rollups selecting objects with Master Detail as well?
The reason for the question is SF limits the number of rollup summaries on Master Detail relationships and I’m wondering if using this tool could be a good workaround for this. Also are there limits to the number of rollup fields we can create on lookup relationships?
Thanks a million for this tool. I’ve spread the word about it in several SF LinkedIn groups.
AFB
February 11, 2014 at 4:59 pm
Thats a good question, its not a use case I’ve tried, but you make a good point as to the possible motive for wanting to go this route as apposed to the native rollups possible on master-detail relationships. I cannot think of any reason why it won’t work at this stage, so feel free to try it and let me know if you encounter any issues via the GitHub issues link, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues?state=open
As regards limits on the number of rollups, no, i’ve not put anything like that in, the only thing that will limit you is the platform 50k query limit as the tool uses aggregate queries internally. I’ve put some updates in the blog about some config i put in to calibrate around this if you hit, there is also some more details on known limitations on the github read me file here, https://github.com/afawcett/declarative-lookup-rollup-summaries/blob/master/README.markdown#usage-information-and-known-issues
February 12, 2014 at 12:12 am
Thanks!
February 14, 2014 at 1:52 pm
Reblogged this on Sutoprise Avenue, A SutoCom Source.
February 21, 2014 at 5:25 pm
Hi Andrew,
I just used your application to update 42,887 case records and it work flawlessly! thanks for sharing your knowledge and code. I’m going to put lookup rollup helper to use in other places as well.
February 21, 2014 at 8:33 pm
Thanks so much for the tweet! 🙂
February 21, 2014 at 6:45 pm
Amazing work! Thanks again for your contributions and being so responsive to the comments here/github. A fine example of the way social coding is supposed to work!
February 21, 2014 at 8:18 pm
Thanks so much for your kind words, moments like this make me proud to be coding for the Salesforce community!
March 15, 2014 at 5:53 pm
Hi,
For unknown reason, I cannot deploy to install the Apex Trigger and Apex Class. Getting this error:
Visualforce Error
System.CalloutException: IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://contexte–dlrs.na10.visual.force.com/services/Soap/m/28.0
Erreur dans l’expression ‘{!deployZip}’ dans page dlrs:managetrigger
I double checked, and do have the remote site settings authorized for my instance.
March 15, 2014 at 5:56 pm
That is odd, that normally resolves it, did you copy paste exactly the URL mentioned in the error message? Are you running a Force.com site in your org by the looks of it, wonder if that causes it an issue? What ends up being stored in the Remote Site setting once its saved?
March 15, 2014 at 6:16 pm
Remote site setting URL is exactly https://dlrs.na10.visual.force.com
No Force.com site running.
Odd indeed, as I got it to work (and it’s great once it does!) on another org and another instance, eu1.
March 15, 2014 at 6:23 pm
Hmmm thats not the URL in the error message though is it?
March 15, 2014 at 6:38 pm
Indeed: https://contexte–dlrs.na10.visual.force.com/apex/managetrigger?scontrolCaching=1&id=a2hF0000000yc9y
March 15, 2014 at 6:52 pm
Its missing the contexte- bit isn’t it?
March 28, 2014 at 9:12 am
Sorry for the late answer, but the problem is still ongoing.
I’m not sure what you mean by your question, sorry.
I tried to deploy on another object, and it does the same error.
I installed it on another SF org without a custom ‘my domain’, and it works just fine. Is this it?
March 28, 2014 at 9:38 am
Yes I believe it is the custom domain. If you copy exactly the URL in the error message when adding the Remote Site it should work. If not please raise an issue on the GitHub repository and I will take a look for you.
March 28, 2014 at 10:27 am
Of course! The trick worked fine, many thanks!
March 18, 2014 at 7:48 pm
Do you have any tips or tricks to calculate for example the number of opportunities in the complete hierarchy of an account? Or is this not possible?
March 18, 2014 at 9:15 pm
I’ve seen others do a rollup from Account to Account by using ParentId as the relationship field. This roles up to each level. You could then add a rollup from Account to Opportunity.
February 26, 2015 at 8:53 am
Hi Andy
I assume given that you can do rollups from Account to Account, you could similarly do rollups from child opportunities to a parent opportunity? If so, would the lookup relationship field be Parent_Opportunity? Am trying that but doesn’t seem to be working. Thanks!
–Alex S.
February 26, 2015 at 4:24 pm
Yes hierarchies can be made to work, check out my blog post on accoutnt hierarchy as a basis
March 19, 2014 at 8:06 am
Thanks! I will give it a try
March 23, 2014 at 4:35 pm
Hi Andy,
Is it possible to use this tool to do a Distinct Count based on a field on the child record? Was a post on the reports group in the success community this week that was looking to do this, which would need a lot of ROS fields otherwise.
The use case was opps and products, and a custom field on products essentially functioning as a product family. They wanted a distinct count of the products in each family on the opp.
thx!
March 25, 2014 at 9:11 am
Hi Andy,
Since I activated the rollup on contacts, my users aren’t able to add new contacts to accounts they don’t own.
See this message: http://i.imgur.com/5KXGTp1.png
When I deactivate the rollup they can add new contacts to accounts they don’t own.
March 25, 2014 at 9:23 am
This happens in Realtime mode not in Schedule mode 🙂
March 25, 2014 at 9:58 pm
I’ve raised this GitHub issue to track this issue, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/22
March 25, 2014 at 12:12 pm
Hi, I think I have an idea what is causing this and a fix in mind, will hopefully take a look this evening for you, will try anyway.
May 1, 2014 at 3:50 pm
Andrew, love the tool! Real expediter for me. Question I have looked and been unable to find an answer for –
one the Relationship Criteria – how would I enter a Contains type filter for a multi-picklist?
thanks!
May 1, 2014 at 9:21 pm
The criteria is a SOQL WHERE clause (we are working on a nice UI for editing btw), however this should give you what you need, http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_querying_multiselect_picklists.htm
May 13, 2014 at 12:32 pm
Hi Andrew,
Thanks a million for this powerful tool.
Juste one question : can we create 2 rollup to the same couple of object/relation ?
If we have a Parent Object ‘Case’ and a Child Object ‘object__c’,
We can create aggregate a number of object__c to case : how much records of object are open…
AND can we create a another aggregate to a number of records close?
That’s possible?
May 13, 2014 at 9:57 pm
Yes this sounds feasible
July 2, 2014 at 4:03 pm
How do you list multiple criteria in the Relationship Criteria? Such as CallType=’a’ or CallType=’b’. I get this error: Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger dlrs_TaskTrigger caused an unexpected exception, contact your administrator: dlrs_TaskTrigger: execution of AfterInsert caused by: System.QueryException: unexpected token: OR: (dlrs)
July 7, 2014 at 11:13 pm
Currently the Relationship Criteria only accepts valid SOQL WHERE clause syntax, http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm. We are working on a better UI for providing criteria. Also take a look at this, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/41. If your still struggling raise a GitHub case with a screenshot and we will help you get the correct syntax, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues?state=closed
July 7, 2014 at 4:41 pm
Is there a way to rollup data from child to parent account, and then on up to the next level parent in the account hierarchy?
July 7, 2014 at 11:09 pm
Yep this blog post shows how…. https://andyinthecloud.com/2014/05/08/account-hierarchy-rollups-clicksnotcode/
July 30, 2014 at 9:02 pm
I am doing a Rollup from Case to Account to find the Max date-time of the most recent closed case. When I hit calculate, it doesn’t update any records. However, when i go to an individual record and update to close- the roll up works. So there is an issue with the Calculate Trigger. Can you please help. johnsmith59153@gmail.com
December 22, 2014 at 2:31 pm
Really sorry for not spotting this until now, is it still an issue? If so, could you raise the issue on the GitHub repo issues list and include a screenshot of your rollup definition please?
April 7, 2015 at 5:51 pm
How do I get to the github issues page?
Diane Ravenstien
[sf]
p 620-931-2965
c 620-727-0061
April 7, 2015 at 5:52 pm
It’s a link in the right sidebar when you view the readme
August 19, 2014 at 2:48 pm
Hi Andy,
Thanks for the tool. Received this when installing:
Deployment Complete
Failures:
permissionsets/LookupRollupSummariesFull.permissionset(LookupRollupSummariesFull):Unknown user permission: AllowUniversalSearch
permissionsets/LookupRollupSummariesReadOnly.permissionset(LookupRollupSummariesReadOnly):Unknown user permission: AllowUniversalSearch
Will this cause an issue with my use of the tool?
August 19, 2014 at 2:53 pm
Are you install via the ‘Deploy to Salesforce’ link (aka unmanaged) or via the ‘Package Install URL’ (aka managed)?
August 19, 2014 at 6:54 pm
I had the same errors installing it today into prod by clicking on the ‘Deploy to Salesforce’ (Git to SF)
August 19, 2014 at 6:57 pm
Yes I think there is a some issue with some orgs and the raw Permission Sets when using the Deploy to Salesforce option. Is there any reason why you are not using the manage package? This should avoid these problems.
August 19, 2014 at 7:01 pm
Meanwhile I’ve added a note to the bottom of the README file for this issue.
August 19, 2014 at 10:13 pm
There isn’t any reason, I just clicked the button 🙂 I installed the managed package into sandbox with no problem.
Here is what log on the page was showing:
…
Status: InProgress
Status: Completed
Deployment Complete
Failures:
permissionsets/LookupRollupSummariesReadOnly.permissionset(LookupRollupSummariesReadOnly):Unknown user permission: AllowUniversalSearch
permissionsets/LookupRollupSummariesFull.permissionset(LookupRollupSummariesFull):Unknown user permission: AllowUniversalSearch
You might want to correct the status when errors occurred to state that Deployment wasn’t successful.
And thank you for the great code! We are using Rollup Helper, but are going to extended the list of rollup fields and trying to do not spend money on the paid version (free edition is limited to up to 3 rollups, no real time)
August 31, 2014 at 7:13 am
Hi Andrew, this is a great tool. One question; is there a way to simply count the number of related records that fit a criteria similar to how the native Salesforce roll-up works? I notice that you can only use date/number fields in fields to aggregate and it is a required field
August 31, 2014 at 8:57 am
You can count records yes, currently you do need to provide a field to aggregate, which i want to remove the need for, as it doesn’t make much sense to have this validation in the count use case. Simply for now provide a numeric field (or formula) you know will be populated.
August 31, 2014 at 9:27 am
Hi Andy,
Thanks I tried a formula (number) field and it wouldn’t accept anything but Date or standard Number field type so I used a date field and it seems to be working fine. Thanks for the feedback
Simon
September 23, 2014 at 7:01 pm
Great stuff Andrew. I’ve been using/paying Rollup Helper for 1 year, and your tool is almost as good (but free). If you’d only develop a UI for SOQL criteria, I would really consider not renewing Rollup Helper. Are you intending to eventually sell this great App? Thanks!
September 24, 2014 at 7:36 am
Thanks for the nice comment, no current plans to sell it no, it depends on community contribution, there has been some discussion on a criteria UI, but no movement on coding it as yet. I myself have been quite busy writing my book most of this year, now that is out, i can focus more of my time on this tool, so maybe i might get to it sometime soon, i know its high on the list of new features for sure! Thanks again!
November 15, 2014 at 2:23 am
Mr. Fawcett,
I thank you for your tool. I installed it on a sandbox and the rollups worked flawlessly. However, I duplicated in our production environment to find that one of the two roll ups I had re-created from my sandbox would not update.
To make it stranger, if I used the manual calculate button, it would recalculate my master record field just fine. So I think my roll up definition is correct. It’s just this one ‘sum’ rollup is not working realtime.
I wish to be respectful of your time. but if you are able to give some gentle guidance for this great tool, let me know. I did capture a debug log that seemed to indicate the trigger did execute successful. I even saw the SOQL statement.
It is also worth noting that I installed v .12 on my sandbox and it looks like you just recently released .13 –which I installed in production.
Thank you!
Brian Schlottmann
November 15, 2014 at 3:11 am
I have a quick update. First sorry I posted here. After a little research I realized that you had an issues board on the Github website where I found this issue
https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/85
This was my exact issue. I was count’ing and sum’ing on the ‘Amount’ field in Opportunities. So i change the count rollup to count the CloseDate field and it is working fine.
I might suggest a simple count record based on a WHERE clause? Not sure if that helps.
Feel free to disregard these comments on the blog post.
Thanks again.
November 16, 2014 at 9:15 am
Ah yes, the count problem, that took me a while to spot, its deep in the docs where it states null values on records for which the field your counting does not increment the count.
When you say “I might suggest a simple count record based on a WHERE clause?” can you elaborate, i just want to make sure i understand this statement?
November 16, 2014 at 4:44 pm
Well, I’m not too familiar with SOQL. I’m more of a sql guy myself. But in excel you have countif() function that counts a row if a condition is met. That might be over kill. Or perhaps you can already do that with the conditional Where as clause you have. But I am thinking that if you could just count against the record ID that would might solve it?
I also am having another issue–if you are able to point me in the right direction hopefully I can solve it. We have a shopping cart product that serves as our store front. What is nice about it is that as you are shopping in the store, it is creates an opportunity record and product line items LIVE as the cart is being filled. Think of the shopping cart as a glorified extension of the salesforce UI. It uses Force.com pages and is 100% native.
However, once I add the first item to the cart and the opportunity is initialized, I get a strange permissions error. It says:
dlrs_OpportunityTrigger: execution of AfterInsert caused by: dlrs.SObjectDomain.DomainException: Permission to access an dlrs__LookupRollupSummary__c dennied. (dlrs) Trigger.dlrs_OpportunityTrigger: line 7, column 1
Best I can tell, the shopping cart force pages do not have proper permissions to access the trigger. I am not quite sure how to fix that. Is that something in your managed package? Or something I can easily fix by tweaking something somewhere?
Thanks again. If you have time to point me in the right direction, I can probably get it figured out. Really enjoying your work!
November 16, 2014 at 7:19 pm
Sounds like you need to add access to the custom LookupRollupSummary__c field to the site guest user profile. To get to this is a little convoluted, but i believe if you go to the site in setuo and click public access settings you will see a way to manage it. I’m on mobile so can’t look it up exactly.
November 16, 2014 at 7:19 pm
RE: Count, yep, count by Id is likely to be what we will default to when using the Pilot UI Wes wrote a while back, since it always has a value! 🙂
RE: Permission error, yeah this is indeed down to lack of permissions to the DLRS objects. I ship some Permission Sets with the package you can assign to applicable users. Both start with LookupSummary if your looking for them in your orgs Permission Set list. If you cannot assign these for whatever reason, simply view them to see what permissions they give and apply to your own Permission Set or Profile.
December 22, 2014 at 2:29 pm
Sorry for missing this comment until now, wondered if you had a chance to try the latest releases of the packages to see if the problem still exists?
November 20, 2014 at 6:02 pm
Hi Andrew! Thanks for this tool. I have been using it without any issues until today. I am getting this error when try to add a new lead that the country is in Saudi Arabia. Hope you can help!
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger dlrs_LeadTrigger caused an unexpected exception, contact your administrator: dlrs_LeadTrigger: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 0015000000GkLCiAAN; first error: FIELD_INTEGRITY_EXCEPTION, There’s a problem with this state, even though it may appear correct. Please select a state from the list of valid states.: Billing State/Province: [BillingState]: (dlrs)
March 9, 2015 at 5:19 pm
Hi Andy
Using this amazing tool with a number of small nonprofits that I am working with. As I’m not a developer. This has been absolutely brilliant. However , have just begun creating some roll ups for an organisation that I had previously installed a trigger in.
I get the following error when I try and deploy the dlrs trigger.
TestDonationMainContactUpdate.myUnitTest System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Name]: [Name] Class.TestDonationMainContactUpdate.myUnitTest: line 32, column 1
I know its something to do with my trigger but not sure where to look.
Any suggestions.
March 9, 2015 at 9:31 pm
Hi andy
Solved issue with some behind the scenes smoke and mirrors.
March 9, 2015 at 9:34 pm
Thanks appreciate the kind words! If you open the test class referenced in the error, near line 32 it will be creating a record and likely not populating the Name field. Did you write the test or another developer?
March 11, 2015 at 12:31 am
Love this tool and have been using it for a while. Question — I have a scheduled job that is running nightly and completing with no errors (3/8/2015 5:00 AM Batch Apex Completed 1 1 0 3/8/2015 5:03 AM RollupJob 7071300001LJCqE). However, it’s not calculating a Lookup Rollup Summary that I have set to Active with Calculation Mode: Scheduled. When I click ‘Calculate’ and manually run a calculate job it works but the scheduled job isn’t working. Is there something I’m missing?
March 11, 2015 at 6:23 pm
The scheduled job only works in response to child record updates which are logged in ‘Lookup Rollup Summary Schedule Items’ related list when you look at the rollup. These entries are only created if the tool notices the value of the ‘Field to Aggregate’ field or any of the fields in ‘Relationship Criteria Fields’ have been changed.
March 11, 2015 at 8:31 pm
Hmm…. any suggestions of what I could do if I’m looking to rollup a formula field? Essentially I have dated contracts as a child object and there’s a formula (1 if Active, 0 if not (Based on expiration_date > today) and my hope was that by running this job each morning I could get an accurate count of how many contracts were active for an Account.
March 12, 2015 at 7:42 am
Hmmm yeah likely the tool won’t see this as a change due to when the formulas on the platform are calculated, you could try a workflow field update to copy it over to a another field and monitor that for changes, of course the users would never see this field.
March 12, 2015 at 5:09 pm
Appreciative the help and responses very much. Thank you!
March 12, 2015 at 5:21 pm
Final question – is there any way to run the RollupCalculateJob as a scheduled job?
March 25, 2015 at 5:12 pm
Hello, I have been using the tool for some time with great success! Thanks so much for your work. However as of today, I am having an issue with a new rollup I am working on. When I go to deploy, it goes through the “Deploying…..” process and then says “Deployment Complete” but also shows “Click Deploy to Install the Apex Trigger and Apeex Class for this child object”, the Deploy & Cancel buttons still showing at the bottom of the page & when I try to Activate the rollup, it gives me an error saying it has not been deployed. Clearly it is not actually deploying despite the message yet I have no error or method of troubleshooting. Any ideas? Thanks!
March 25, 2015 at 6:37 pm
Are you running the latest version of the package?
March 25, 2015 at 7:59 pm
Thanks for the prompt. I was not on the latest version. I did install and now actually get a more informative null: The changes you requested require salesforce.com to temporarily lock your organization’s administration setup. However, the administration setup has already been locked by another change. Please wait for the previous action to finish, then try again later.
April 7, 2015 at 5:43 pm
I have v 1.9. With the spring 15 release 1.19, is this something I should upgrade? I recently have experienced my roll up not working. I should be seeing a total of 2 and it remains at 0. How do I begin to troubleshoot, since it used to work? I have NOT ran an upgrade.
April 7, 2015 at 5:45 pm
Nothing to upgrade if you had a working rollup before, can you raise an issue on the github issue list and include steps and a screenshot of your Rollup please.
April 16, 2015 at 5:51 am
Hi Andy, great tool by the way. I was wondering if anyone could help with a SOQL statement. I want to query records for a certain week in the future. I can use THIS_WEEK and NEXT_WEEK to query records for the next two weeks individually but what if I wanted to query records for week 3 or week 4.
April 16, 2015 at 12:27 pm
Thanks for the kind words! Can I ask if it would be ok to post this question in the chatter community group? There is a link to this group on the Readme file for the tool.
April 16, 2015 at 11:13 pm
Thanks Andrew I’ve moved the question as requested
April 26, 2016 at 4:26 pm
Hi – we had a field that was calculating a subset of transactions….the recalculate feature did not seem to be working….turns out we were on version 1.22, so I upgraded to 2.3…but the rollup summary field is not recalculating after pressing “calculate.” the field is set to realtime.
in addition to updating the installed app, are there other updates we need to make?
this app was installed by a consultant who is no longer with us…i’m trying to catch up and figure everything out! thanks in advance.
April 27, 2016 at 12:16 pm
Are their any errors in the Apex Jobs screen? Also in terms of realtime edits or inserts etc to child records, if that is not working, check if your using formulas as part of the rollup, there is some additional considerations I detailed in a blog I wrote recently, see blog links in the doc section of the readme file
June 23, 2016 at 3:21 am
When it comes to the realtime trigger logic, does the 20 query limit imposed on trigger execution by the platform impact processing in any way? I’ve done some study of the code on Github and have not been able to determine if this is the case. My assumption is this, if the 20 query limit is a factor, I suspect this would mean that each object would be hard limited to no more than roughly 18 – 20 rollup summary definitions. Though, this may be getting bypassed in some way, if so, how is this being achieved?
Thanks!
June 25, 2016 at 7:53 am
The number of SOQL queries that can be made in one execution context / request invoked by the user is 100 per managed package namespace (within the DLRS code). If you had 20 rollup definitions the maximum they would take up is 21 SOQL queries (1 to query the rollups if your not using custom metadata mode). That said however depending on if they share some configuration the tool will attempt to merge rollups into a single query, so this number could come down. I’m currently pondering some kind of profiling tool to better illustrate this actually. The real issue though with having to many rollups active, is the processing time and number of rows, especially if they are all Realtime. Your likely to hit issues like 50k or CPU Timeout before hitting the number of SOQL queries limit of 100. When designing your rollups try to consider which you need Realtime and which can be Schedule mode (there is also a daily Scheduled recalc mode which requires no trigger logic at all). Note also that the batch jobs can also hit governors, though you can use the custom settings to flex the scope size to address this. Hope this helps.
June 26, 2016 at 3:42 pm
Yep, that cleared things up for me, I had read in the Apex docs somewhere that triggers will hit the SOQL query limit at 20 or more executed queries (from my initially expected 100), and seeing that the entry point for the realtime execution is in a trigger, that is what lead me down that road of thought.
Thanks for the info!
June 23, 2016 at 3:22 am
When it comes to the realtime trigger logic, does the 20 query limit imposed on trigger execution by the platform impact processing in any way? I’ve done some study of the code on Github and have not been able to determine if this is the case. My assumption is this, if the 20 query limit is a factor, I suspect this would mean that each object would be hard limited to no more than roughly 18 – 20 rollup summary definitions. Though, this may be getting bypassed in some way, if so, how is this being achieved?
Thanks!
June 25, 2016 at 7:53 am
I think i just responded to this question?
June 26, 2016 at 3:44 pm
Yes, not sure why this posted twice. haha
August 17, 2017 at 2:16 pm
Hi Andy. I am using a custom metadata rule to count the number of child records that is associated to a given parent record and updating a number field in the parent record. The field to aggregate on is the Id field; sharing mode is System. When the rule is in real time mode it works under all scenarios. I have changed the rule to Developer mode and am calling the api in apex code to meet some business requirements around merging. That works in all scenarios except one. When I change the lookup field of the child record to a different parent, the new parent’s count is incremented correctly, but the old parent’s count is unchanged. This happens only when the old parent no longer has any children of that object. In the code to update the old parent, I am passing an empty list of child records to the rollup method. Am I doing something wrong? Thanks in advance for any suggestions.
August 17, 2017 at 2:24 pm
Thinking about this further, the service probably has no way of knowing what the old parent was in order to update it, but somehow in real time mode it knows.
August 17, 2017 at 3:14 pm
I did find a reference to a similar issue at https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/167. We are using version 2.9. I do have a fairly simple workaround to implement if necessary.
August 24, 2017 at 12:26 am
Are you using the API that takes the old and new list of child records? If so it should work per the trigger context.
December 16, 2017 at 2:12 pm
Is this tool still available on the App exchange? Has the name changed by chance?
I have a client with it installed (by another consultant) and I wanted to add it to another one of my clients orgs.
December 21, 2017 at 1:32 pm
I will likely make the listing public over the holiday, but for now it can for sure be installed like a regular package, just head over to the links in the GitHub Readme file.
December 30, 2017 at 7:43 am
Hi,
I am running a flow that throws the error: Error Occurred: This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: dlrs_CampaignTrigger: System.LimitException: dlrs:Too many SOQL queries: 101.
I tried the same approach of scheduling the existing Lookups on Campaign object, but still no help. What is it that I am missing here?
January 4, 2018 at 6:13 pm
It may be best to continue this discussion on the Chatter group linked from the the README file for this tool. Please make sure you have set the mode to scheduled on the rollup. Also check the schedule mode wiki page also on the GitHub repo.
January 4, 2018 at 1:01 pm
Hey Andrew. I am dealing with a lot of data in Salesforce. Some parents definitely have more than 50k child records on them. Is there any way to running a DLRS calculation for my case. It seems that the rollup calculations you make do not use the batchable interface.
For now, I am writing a bachable class to run batches of 200 records at a time, temporally storing and adding the result of each batch to the next until all records are processed to have a final Count update on the parent. Is this the way to go for now?
Thanks a lot!
January 4, 2018 at 6:21 pm
Unfortunately breaking it up as you propose is the only way. It is a platform limit that only a max of 50k records can be queried at once, unless you run in read only mode, but that’s obviously not going to fit your use case. Sorry it’s not better news.
January 5, 2018 at 7:30 am
Thank you so much for your answer. I was able to complete a count using the Database.Batchable and the Database.Stateful interfaces. It really wasn’t too complicated, but I know at a higher abstraction level this could get quite tasking. By any chance, do you have future plans to add batch functionality to the DLRS? I don’t really know how many people are dealing with massive amounts of records in Salesforce like me though so I don’t know if the benefits vs cost of implementing is worth it.
January 5, 2018 at 9:17 pm
Glad you got this working! No plans at present. There are plenty enhancements listed though!
February 16, 2018 at 4:32 pm
If building in my own logic to prevent dlrs from firing on certain type of records what do I pass in the trigger to the handler.
I modifed the dlrs trigger to check the record but then do I pass the trigger.handler a list?
I know bad form to put logic in a trigger.
List xList = new List();
For(x xr : trigger.new){
If(something about the record){
xList.add(xr);
}
}
The trigger handler doesn’t accept lists should I be passing it a list and a map aka trigger.new and trigger.oldmap?
February 16, 2018 at 8:04 pm
There is another api on the rollupservice class that takes the maps.
February 16, 2018 at 8:07 pm
Does it still do all the magic of checking the relationship criteria fields for changes? I’d still love to leverage all of the intelligence of the tool just not send every child record over to it. Reading the doc there is the rollup call where you send it a list but then it just processes the list without doing all of the checking logic. I found a method that takes newmap and oldmap but it is private so I’m not sure how to call it.
February 16, 2018 at 8:08 pm
Yep all good
February 16, 2018 at 8:14 pm
Ahhh there it is, I must have been looking at an old Rollupservice doc in the GitHub! Thanks!
February 16, 2018 at 8:15 pm
Don’t forgot to post / blog / wiki your use case! We could do with some more docs on the api tbh… 😉
March 24, 2018 at 7:09 am
Andrew, first of all – this tool is magical. Saves me countless hours. There is one issue I am having – while trying to adjust the Scheduled and Calculated Job scope size of 100 to a smaller number, the custom setting isn’t allowing me to edit the numbers because the fields are managed.
March 25, 2018 at 5:44 pm
Custom settings ui is an odd one. Click the manage button to edit the records
June 28, 2018 at 11:54 pm
Hello,
I am having an issue with scheduling the batch for the roll up summaries i have created. Basically i have 33 rollup summaries that i have created and i want to schedule all the batch at once. I have done the following steps:
–Go to the Roll up summaries and click on manage trigger
–schedule the class RollupJob daily.
However, this is not working. When i schedule it unitary (One rollup summaries at a time), it is working for some roll up summaries.
As i have 33 roll up summaries, it is difficult to schedule it one by one
Can you tell me if it is the right way to schedule the batch? Have i miss a step?
December 15, 2018 at 2:21 pm
Ok first of all its worth getting to know the schedule modes of the tool. This should help > https://github.com/afawcett/declarative-lookup-rollup-summaries/wiki/What-you-need-to-know-about-Scheduling-Rollups. Basically, Scheduled Incremental Calculate uses only one scheduled job for any pending rollups, so its worth taking a look to see if this mode works for your 33 rollups. Scheduled Full Calculate requires a schedule per rollup currently. I believe there is an enhancement logged to combine Scheduled Full Calculate into a single job but its not implemented yet.
October 17, 2018 at 6:06 am
Hi Andrew- Our org has installed Declarative Lookup Rollup Summary package in 2016 and we are in version 2.5. I just saw that you have released version 2.11. How do I upgrade to version 2.11. Please advise. Thanks!
December 15, 2018 at 1:03 pm
Thats easy you just click the link and Salesforce upgrades for you direct to that version…. however…. please do read the notes in the README file you are quite some way behind and will need to perform any post install steps between these two versions that have been noted in the README.
October 19, 2018 at 4:28 am
I have a dumb question I think but I’m stumped. I can’t figure out how to identify what this ID represents. 70746000020tSRZ. It doesn’t point me to a calculate job (a0z), or a roll-up (m00), or anything that seems to work in a URL. How can I identify what caused my error? Developer script exception from XX: ‘dlrs.RollupCalculateJob’ for job id ‘70746000020tSRZ’ : dlrs:Too many query rows: 50001
December 15, 2018 at 12:59 pm
Hmm thats an odd looking idea tbh…. have you tried pasting it into the URL in the browser? e.g go to any record view page and substitute its id with this one?
December 16, 2018 at 6:11 pm
Yes I did, it didn’t work. We’ve gotten an error message with this type of ID in it several times. I can never figure out what the error actually was.
October 28, 2018 at 2:25 pm
Hi Andy, As above thanks for what is an amazing tool. Can you tell me what determines the order of operation of roll up summaries on the same object. I am assuming it is created date so the run sequentially from when you added them?
Also, can we alter this order in the apex class etc?
Thanks )
December 15, 2018 at 12:54 pm
The ordering is based on the Parent Object and Relationship field contents alphabetically sorted in ascending order. If you want to control the order the RollupService class has methods that might help but it does look like those methods obey the above order. My only thought is to call this method.. https://github.com/afawcett/declarative-lookup-rollup-summaries/blob/master/force-app/main/classes/RollupService.cls#L148 several times with the respective rollup you want. Keep in mind though the optimization to combine rollups into one SOQL query will not be available if you do this. That said, if you’re rollups differ on criteria, child object and some operators like COUNT vs FIRST, then this will not matter as it still does separate queries for each rollup anyway. Hope this helps!
January 8, 2020 at 9:28 am
Silly Question: How do I get to the Custom Settings?
I run the Calculate button for an Account Rollup Summary field, I limit it to 2000 records and I still get the “First error: dlrs:Too many query rows: 50001” error message in my Apex Jobs listing.
The company I’m working for already had the “Manage Lookup Rollup Summaries” App installed from the Salesforce App Launcher. I’m not sure if I need to install a separate Tool.
Thanks in advance!
January 8, 2020 at 9:50 am
Never mind… I was overthinking that I was looking for a custom tool with custom settings… not that it was just under Salesforce Custom Settings. Oopsie. Thanks!
January 20, 2020 at 6:50 pm
Search under Setup menu
July 8, 2020 at 6:35 am
I have a similar issue from Laura Above. I am receiving the below ApexApplication Error, but I have multiple rollup jobs and the ID this references does not seem to help me identify which job is having an issue (i.e. 7073p00006iLr4V’)
“Failed to process batch for class ‘dlrs.RollupCalculateJob’ for job id ‘7073p00006iLr4V’. Salesforce System Error: 1019465399-75104 (1476628552) (1476628552)”
July 20, 2020 at 9:17 am
What you have here is a Salesforce Gack – https://developer.salesforce.com/blogs/engineering/2015/02/gack.html#:~:text=A%20gack%20is%20our%20blue,catch%20it%20and%20handle%20it.