NEW RELEASE: SPRING’14 RELEASE NOTES
Here is a tool I’ve been working on for the past two weekends that helps address a current platform limitation around rollup summaries. Specifically the inability to do rollup summaries between lookup relationships. This is possible between master detail relationships using the declarative mode of Force.com, but not between lookup relationships.
A while back I came across a rollup Apex library (LREngine) written by a fellow Force.com MVP (Abhinav Gupta). Which helps reduce the coding effort significantly and uses SOQL Aggregate queries internally. However it requires some developer skills to use the library and deploy the necessary triggers to your org, as well as repeat of this to make changes in the future. Not very declarative I thought.
So if you’ve been following my blog you’ll know that I’ve been doing things in Apex with the Metadata API (used for, amongst other things, deploying code!). So in order to make the LREngine library more accessible to admins without access to developers or coding skills. I decided to build this tool around the library. Which automates the generation of the required ‘very small’ Apex Trigger (and test code) to allow you to deploy it direct from your org, without any change sets, developer orgs or Eclipse install insight!
The tool revolves around the use of a single object, Lookup Rollup Summary. This objects lets the admin declaratively define the rollup definitions! The following rollup definition updates the Annual Revenue on the Account, each time an Opportunity related to it is inserted, updated or deleted. As an optional feature, a SOQL WHERE clause can be specified that acts as a kind of Rollup filter criteria should you need it. In this case only Opportunities greater than 200 are included in the rollup.
Activating the Rollups
This release of the tool supports the Realtime calculation mode, as the users manipulate the child records the tool automatically updates the rollup fields on the parent object. To activate rollups using this mode you must click the Manage Child Trigger button.
This will present a UI that will allow you to easily deploy or undeploy the required Apex Trigger directly from the page, the page also shows the minimal code (most of the generic logic is in the managed package) for confirmation purposes.
Note: In a future release a Scheduled calculation mode will be supported, here no triggers need to be managed.
Installing the Tool
The tool is available via a managed package to install into your production environment (sandbox testing always recommended however). I’ve also shared the whole code for it in my Github account here, should you want to fork it and/or combine it in other solutions directly. These are the steps to install the current package.
- Install the packaged version by reviewing the release details here.
- Add a Remote Site setting for the Metadata API callouts the tool makes,
- Setup > Security > Remote Site Settings
- Use the following URL, https://dlrs.eu2.visual.force.com (adjusting the instance part accordingly).
- Note this URL endpoint points back to your Salesforce server, as even callouts out and back into Salesforce servers needed to be defined here.
- Locate the Lookup Rollup Summaries tab and create a record as above (don’t check Active yet)
- Click the Manage Child Trigger button and click Deploy.
- Edit the record you created in step 3 and check the Active field
- Provide feedback via the Github Issue tracking facility here.
Whats next… upcoming Features!
I’ve got the following features in the pipeline for the tool, if anybody wants to help me please reach out!
- Schedule calculation mode, if you don’t need realtime updates of your rollups, a schedule job will periodically update them for you. This calculation mode does not even require a trigger to be deployed.
- Calculate button, if you add a rollup for existing child records or make some changes, this button will bring your rollup values up to date on the parent objects.
- API, by providing an API, then developers who may already be writing triggers on the related objects, can call out to the engine and still leave the admin the ability to configure the rollups declaratively.
- Further robustness improvements, better run time checking of fields defined on the rollup definition (in the case where these get renamed or deleted after the rollup was defined).
February 21, 2017 at 11:47 pm
Eeeeeeeek! This just saved me. I’ve been trying to figure out a solution on my own for weeks and after enough googling, I stumbled upon your post and your solution. Thank you so much for sharing this with the community!!!
FYI – here’s the scenario I’ve been struggling with that this solved: We have created an opportunity hierarchy using a Parent Opportunity lookup field. We want to be able to report on the total value of child opportunities on the parent opportunity. This tool worked perfectly.
[doing a happy dance]
February 21, 2017 at 11:48 pm
Excellent go you! Keep dancing!
March 22, 2017 at 11:42 am
Hello Andrew,
Is your tool work with standard objects like AccountTeam or opportunityTeam?
Thx
Regards,
March 25, 2017 at 9:21 pm
Yes, some only work in scheduled mode though. Try it out and raise issues in the Chatter Group linked on the readme file.
April 12, 2017 at 7:06 pm
Please Help! I am unable to get this to work in my sandbox. When I attempt to Calculate I get an error indicating the Rollup must be “active” but I am not seeing anywhere to set it as active or not??
April 12, 2017 at 7:08 pm
Also I find it strange that when I try to use the Enhanced Edit – the Child Field to Aggregate picklist does not contain the field on the child object that I want to summarize – I am able to specify it when I create the rollup…but it is not available in this enhanced edit mode.
April 12, 2017 at 11:19 pm
This could be a bug. Have you seen that there is a Chatter Comminity group linked on the Readme file. Lots of help in that group also. You can also search for known issues on the GitHub page for this tool. Finally try to use the Manage Rollup Summaries tab this is the recommended way to define rollups and is backed by custom Metadata that allows you to migrate your rollups via change sets
April 12, 2017 at 11:16 pm
This is a field on the rollup definition
April 13, 2017 at 1:02 pm
Found it! My problem is that I can’t deploy the trigger – I get the following error:
IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://berry–bqa1–dlrs.cs12.visual.force.com/services/Soap/m/28.0
Error is in expression ‘{!deployZip}’ in page dlrs:managetrigger: (dlrs)
Here is the remote site setting:
https://dlrs.cs12.visual.force.com
This is in a sandbox environment with a custom domain. The URL for the sandbox is https://berry–bqa1.cs12.my.salesforce.com
April 13, 2017 at 6:49 pm
Ok – I think Im on the right track now…seems I installed a WAY old version of the tool. Updated it and am currently waiting for the first calculate job to complete – THANKS!!
May 6, 2017 at 1:40 am
I am using Account and a custom child object. I can’t get it to work in Real Time, but I can get it to work when I do Calculate and put in a simple Name LIKE … query. Is there something I could be leaving out ? It’s activated, and I have indeed chosen Real Time. I’m not using any of the optinal fields such as Relationship Criteria or Relationship Criteria Fields.
May 6, 2017 at 2:22 am
In realtime mode the tool needs to know what fileds to watch for changes in. By default this is the field your aggregating. So if that changes the realtime recalc will be done. If your changing other fields, you need to list them in the Child Relationship Fields field (if you don’t have a filter).
May 6, 2017 at 4:33 am
ah ok – that makes sense. So I guess it will work in Schedule then ?
May 9, 2017 at 1:34 pm
Hi Andrew,
Thanks for sharing. I have a difficulties with deploying Apex Trigger. Would you please advise of how to resolve this issue?
Error:
dlrs_SCMC_Production_OrderTest.testTrigger System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Item is required: [SCMC__Item_Master__c] Class.dlrs.RollupService.testHandler: line 272, column 1 Class.dlrs_SCMC_Production_OrderTest.testTrigger: line 11, column 1
Warning:
dlrs_SCMC_Production_OrderTrigger:Test coverage of selected Apex Trigger is 0%, at least 75% test coverage is required
May 23, 2017 at 10:20 pm
Take a look at the wiki on the GitHub repo it has an article around code coverage and test code needed in cases like this. The default test code the tool generates does not comply with the validations in your child object.
May 26, 2017 at 8:54 pm
We are using this to calculate a value that is an ‘average’. (i.e. the average number of match items for all child records in a group). The values returned are frequently more than 2 decimals, however, and we want to display them in an email {mere field} with 2 or less decimals. The Salesforce fields show 2 decimals when viewed on the account or in reports, but the merge field is pulling more. How can we limit the output from the rollup summary so the merge field displays correctly?
May 28, 2017 at 5:44 pm
I am not sure, its worth asking this in the Chatter Community Group (see link on README). Meanwhile i did a brief bit of Googling for you and found this, https://success.salesforce.com/answers?id=90630000000gvfcAAA
July 18, 2017 at 11:31 am
HI Andy
I am getting error when i deploy the code. code coverage is not done please can you help me.
July 19, 2017 at 10:29 pm
Do you need to deploy the code? Why not just install via the package link?
August 8, 2017 at 10:52 am
Hi Andrew ,
is there any limit with this app.
i am not getting new button after clicking on lookup rollup summary tab.
thanks
rajni
August 9, 2017 at 2:26 am
There are two ways to create rollups. Recommended is via the “Manage Rollup Summaries” tab. This supports custom Metadata and allows for easier migration of rollups from sandbox to production. The “Lookup Rollup Summaries” tab is the original option. You must manually copy over rollups from sandbox to production here. If you do want to use that option, keep in mind when opening that tab to see New you need to click Go and have the correct permissions assigned, these are permissions sets under setup for the tool. Hope this helps.
August 11, 2017 at 2:34 pm
Hi Andrew, this has proved VERY useful!
I’m not the most experienced with this stuff, I’ve got a Roll-up to sum all “donations” (a custom object) for an activity but can’t find a way to make the same field but only for those ‘donations’ within a time frame, I.E a financial year. I’d love to be able to set it up and it update the dates for the FY each year rather than enter dates every April, but I can’t even get it to understand “equal to or greater than ___ date and Equal to or less than ___ date.
Any ideas?
Thanks so much for this AMAZING tool! 🙂
August 12, 2017 at 10:40 pm
Thanks! Take a look at the examples here. Also review the schedule modes on the wiki,l carefully. https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
August 14, 2017 at 3:22 pm
Thank you Andrew, managed to get what was needed using that link!
Thanks again,
Harry
August 31, 2017 at 5:43 am
Hi Andy,
I am trying to rollup Article (child) information to a Case (Parent) custom field but I get an error:
Error:
triggers/dlrs_CaseArticleTrigger.trigger (Line: 4: Column:36) : SObject type does not allow triggers: CaseArticle
Cases can have multiple articles attached. I want to capture the date/time of the article that was created the last one.
Salesforce stores this information in the CaseArticle table and the Rollup Helper tool displays it but it does not work well in our org.
Knowledge Articles do not support triggers, so this is where the error may come from?
Thank you for your support!
Julian
August 31, 2017 at 5:52 am
Same error message appears when using the API name of my article type (HSM_Article__kav):
Error:
triggers/dlrs_HSM_Article_kavTrigger.trigger (Line: 4: Column:40) : SObject type does not allow triggers: HSM_Article__kav
The strange thing is that in both cases I also get, right below the error message, another message saying “Deployment Complete”
However the roll ups do not work
August 31, 2017 at 8:02 am
This one is odd, as I assume this a custom object?
August 31, 2017 at 8:01 am
Yes this is correct, your only other option is to use the full schedule recalc mode. See the wiki article on the GitHub project for more.
September 6, 2017 at 2:41 pm
Hi Andy – This is a fantastic product and I am finding a number of uses for it. Thanks for creating this. Gotta question for you. In the scheduled job, I’ve added a filter “Rep_Type__c = SOB AND Status__c = Active”. After saving, the filter no longer shows. Only the example “Name LIKE ‘Fred%’ AND Custom__c > 0” shows. Even though it doesn’t show, will my filter still apply to my scheduled jobs?
September 18, 2017 at 12:28 pm
Yep it will
September 19, 2017 at 4:05 pm
Thanks. One last question. I am rolling up sales rep activity onto a custom object called Agent. There are 6 fields which I rollup data to (calls, quotes, sales, etc.) Each sales rep has 2 Agent records. One for Inbound work and the other for Outbound work. When the trigger fires, some of the data gets added to the Outbound record and the other data is added to the Inbound record. For example, calls and quotes get added to the Outbound record and sales # gets added to the Inbound record. Is there a way to set it up so that only the Outbound record gets updated with all of the data? Or, is there a way to update both records with all of the data?
September 27, 2017 at 2:02 am
So you have Custom object > sales rep > outbound and Custom object > sales rep > inbound object relationship? If so you need to define a rollup between each relationship to bubble the information up to the custom object you need
September 11, 2017 at 8:12 pm
Hi there and thanks so much for this awesome tool. I am using it for the first time and although I think I set this up correctly it seems that the rollup isn’t populating. Basically I created the rollup and have connected it using the manage child trigger. I have set all the fields and checked the code in my relationship criteria and listed all of the criteria fields on seperate lines, the rollup summary saves and is activated. The figure isn’t showing up and not sure why, I created a lookup link and a new custom object to place these rollups and its still just blank in there.
Its a one person team here from a primary school in new york so any help and steps much appreciated.
Any help much appreciated.
September 11, 2017 at 8:29 pm
Also I should add i used a currency field as the field that will be rolled up to should I have used a text field?
September 18, 2017 at 12:31 pm
That’s fine, text fields have limited operations.
September 18, 2017 at 12:31 pm
Do you have a realtime rollup or scheduled? If it’s the later check the wiki on the GitHub repo for further instructions.
September 20, 2017 at 4:56 pm
Thanks! OK so this is working now, amazing. I do have another issue though. I am using a process builder to update the lookup field I have with the same id each time a record is created so I can roll-up these figures to a specific object. That works great up to a point but once I tried to add a couple more I am getting an error and the records cannot be saved at all. When I delete the newly made roll-ups it works again.
Is there a limit to how many roll-ups I can create before process builder cannot update the field it needs to? Its such an odd issue but I do have about 35 roll-ups currently. If I were to schedule to roll-ups would I have more success do you think? They only need to run once a month. I have the error message here below if you think its useful to see.
Error Occurred During Flow “PRRU_000001date_Purchase_Request”: The flow tried to update these records: nul…
Error element myRule_1_A1 (FlowRecordUpdate).
The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: dlrs_Purchase_Request_FormTrigger: System.LimitException: dlrs:Too many SOQL queries: 101. For details, see API Exceptions.
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: PRRU_000001date_Purchase_Request
Type: Workflow
Version: 1
Status: Active
Flow Interview Details
Interview Label: PRRU_000001date_Purchase_Request-1_InterviewLabel
Current User: Aaron Louie (005G0000007BpTo)
Start time: 9/19/2017 12:42 PM
Duration: 1 seconds
How the Interview Started
Aaron Louie (005G0000007BpTo) started the flow interview.
Some of this flow’s variables were set when the interview started.
myVariable_old = null
myVariable_current = a4s0f000000XyTaAAK
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = “9/19/2017 12:42 PM”
DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!formula_myRule_1} (true) Equals true
Logic: All conditions must be true (AND)
RECORD UPDATE: myRule_1_A1
Find all Purchase_Request_Form__c records where:
Id Equals {!myVariable_current.Id} (a4s0f000000XyTaAAK)
Update the records’ field values.
Purchase_Request_Roll_Ups__c = a2D0f0000016gw2
Result
Failed to update records that meet the filter criteria.
Error Occurred: The flow tried to update these records: null. This error occurred: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: dlrs_Purchase_Request_FormTrigger: System.LimitException: dlrs:Too many SOQL queries: 101. For details, see API Exceptions.
Thanks again for this amazing tool
September 27, 2017 at 2:06 am
This is a platform limit the tool cannot avoid. Generate a debug log and review it carefully or use the dev console and use the Execution Overview pane. What I think is happening is some recursion causing the trigger to fire over and over until the governor fires. Other option maybe to use one of the schedule modes (see wiki before using schedule modes).
September 20, 2017 at 6:33 pm
I’m having the same challenge with my rollups that aren’t populating. I have one date/time field and two text fields. I suspect it is the aggregate operation perhaps. I’ve tried first, last, concatenate. The others (sum, max, min) gave errors and wouldn’t allow me to select/save the rollup until I changed it.
I am using this for two custom objects that had a master/detail relationship. When the rollup wasn’t working, I created a lookup relationship between them, but still no luck.
Any suggestions?
Thank you,
Helen
September 27, 2017 at 2:07 am
I would advise going back to the rollup summary the platform provides and trying that again it is always going to perform better than this tool tbh
October 18, 2017 at 10:19 am
Does this work between two custom Objects? I have been trying to get it work between two custom objects but no luck. it works like magic when I chose one of the standard object (wither Parent or Child). could not find anything related to it in the documentations as well. Please suggest.
October 19, 2017 at 4:46 pm
Yes works with two custom objects. Drop your error in the Salesforce Community Group, I and many others can help out then
October 19, 2017 at 8:32 am
Hello Andrew,
We have more than 3 millions records in the object ‘Lookup Rollup Summary Schedule Item’ and i see that this object is used only to keep history, we use declarative lookup between two customs objects and we want know if we can truncate this object because all our fields are filled on the parent object? could you confirm this?
Regards
Nadir
October 19, 2017 at 4:49 pm
Yes you can. This object drives the incremental rollup recalcs when using the applicable schedule mode. So it looks like the schedule job is not clearing these or it’s not scheduled. Take a look at the wiki article on the GitHub repo for an explanation of the schedule modes. It sounds like if you have not noticed any rollups not calculating you may have a rollup that’s not needed but still outputting entires that are not needed?
October 23, 2017 at 8:56 am
Hi Andrew,
I have one scheduled lookup and it calculate the number of cancelled order(custom object), i have the good value in the agregate result field but records in dlrs__LookupRollupSummaryScheduleItems__c are not deleted.
How can I know if the scheduled job is executed or not yet plz?
October 23, 2017 at 6:00 pm
Under Setup search for Scheduled Jobs
October 24, 2017 at 6:46 am
Hi Andrew,
My job is executed every hour but he didn’t delete this lines from the object dlrs__LookupRollupSummaryScheduleItems__c, i have a scheduled rollup summary between Order__c and Order_Line_Item__c with dlrs__RelationshipCriteria__c = “Status__c = ‘Returned'”, but our schedule rollup summary don’t delete the record after executing of the job? i find the good value expected in my Aggregate Result Field
If my job is executed, i can schedule a job to delete evry day the records not deleted?
thanks by advance
October 20, 2017 at 5:10 am
Andy,
Are the triggers that are deployed bulkified? We are running into issues here with Too Many SOQL Queries and the like. I am just reaching out to any vendor that has triggers as part of our managed packages to double-check. Thanks.
October 20, 2017 at 2:58 pm
Yes they are. But… if you have multiple rollups, over different parent objects, different criteria this does end up using different queries, since these cannot be combined into one.
October 27, 2017 at 12:15 pm
Is it possible to do a Contains operator in any way in the relationship criteria? As in, Field1! Contains ‘text’
Another way to reach what I’m looking for would be to be able to do an OR on the same field? An example: (Field1!=’abc’ or Field1!=’def’) AND Field2!=’text’
I tried the above field, which allowed me to save, but it’s not filtering when I run it.
October 29, 2017 at 3:25 pm
Take a look at this https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_comparisonoperators.htm or create a formula field. However be sure to list any fields used in the formula field in the “relationship criteria fields” field as well
November 25, 2017 at 8:17 pm
Andrew , What a great tool my recommendations. I’m not a programmer but was basically writing my own trigger when I stumbled on this post. Made my life so much easier. I did not read it all yet but I noticed I built two rules on one objects accounts and when I went to deploy the second object it asked me to delete the first trigger I’d created. eg I wanted to do both count and sum of 2 different fields from the related object ( also an account).
Thanks again it was great.
November 25, 2017 at 8:21 pm
sorry it should say when I went to deploy the second rule
November 25, 2017 at 8:29 pm
Sorry maybe this will answer my own question. when I create the second rule on the same object. does the manage the deployment combine both rules into the one trigger? I’m guessing yes I did not go and check the code but I suspect that is what you will tell me .
Thanks again great tool.
November 26, 2017 at 11:53 am
Hi Colin, yep you figured it out, the same trigger is shared by all rollups on that child object. Have fun!
November 25, 2017 at 8:31 pm
OK I tested it be re-activating the other rule and sure enough works like a dream.
All the best. Great tool for experienced admins
November 28, 2017 at 2:38 pm
This looks awesome. Two questions, can we rollup from a Formula field if that field type is a number on the child object? Also what is the link for the managed package for this so we can install? I could not find it on the AppExchange
November 28, 2017 at 11:36 pm
Yes you can. Refer to the links in the GitHub Readme file for install links. Also see the documentation section for blogs links, there is one on formula field considerations.
November 28, 2017 at 5:27 pm
@Andrew Fawcett Trying to create a Rollup Field based on of the ParentId field. Basically, I want to know the number of Child Accounts under an account based off the ParentId field. When I trying to setup up the record I am getting the below error :
Child Object: Object does not exist.
Below are my Record details :
Parent Object : Account
Child Object : Account
Relationship Field : ParentId
Field to Aggregate : ParentId
Aggregate Operation : Count
Aggregate Result Field : Number_Of_Child_Records__c
Is there anyway I can get around this 🙂 Thank you in advance
November 28, 2017 at 11:39 pm
That is most odd, Account as a value looks good to me. It’s best to post a screenshot in the Community Chatter Group setup for this tool. See GitHub Readme file for the link.
December 19, 2017 at 9:23 am
Andrew
I have been using this tool for about a year and it works pretty well. I have scheduled jobs that run every hour on four different custom fields that are conducting rollups on the contact record. I have encountered a corner case situation when I merge duplicate contacts, the rollups do not seem to recalculate totals when the schedule jobs runs. I have tried to use the “calculate” button to bring records up to date manually but it throws an exception and says I already have jobs scheduled.
Thanks for your help to resolve this.
Paul
December 28, 2017 at 10:39 pm
There is a feature added in a more recent release to support merging. You have to click the Manage Child Trigger Buffon and remove the trigger code then re add them, when you do this for a merge capable object the Manage Child Trigger button generates trigger for the parent and child objects, so the tool can detect merge operations. Please check through the release history of the tool on the Readme for more information.
February 5, 2018 at 8:47 am
@Andrew Fawcett – Would this tool help with a Roll up field from the Lightning Enhanced Notes. Trying to put “Latest Note” on an Opportunity based on Enhanced Notes related to that Opportunity. However, I can’t find an Object to specify with Notes. Doesn’t look possible. Is that right?
February 6, 2018 at 5:57 pm
I am not sure tbh, but I think this question has been asked before in the Community Chatter group. See readme for a link to that. If not, I recommend you post a new question.
February 9, 2018 at 11:38 am
I’ve left this comment on Dan Kludgy’s post “How to DLRS” as well. I installed the app (version 2.9) in our Sandbox. After creating a Lookup Rollup Summary, I clicked on the Manage Child Trigger button and then chose Deploy I got the following error messages:
classes/dlrs_AccountTest.cls (Line: null: Column:null) : Not available for deploy for this organization
classes/dlrs_OpportunityTest.cls (Line: null: Column:null) : Not available for deploy for this organization
classes/dlrs_OpportunityTest.cls-meta.xml (Line: null: Column:null) : Not available for deploy for this organization
classes/dlrs_AccountTest.cls-meta.xml (Line: null: Column:null) : Not available for deploy for this organization
triggers/dlrs_OpportunityTrigger.trigger-meta.xml (Line: null: Column:null) : Not available for deploy for this organization
triggers/dlrs_AccountTrigger.trigger (Line: null: Column:null) : Not available for deploy for this organization
triggers/dlrs_OpportunityTrigger.trigger (Line: null: Column:null) : Not available for deploy for this organization
triggers/dlrs_AccountTrigger.trigger-meta.xml (Line: null: Column:null) : Not available for deploy for this organization.
Because of that I now can’t save any changes in the Lookup Rollup Summary (to make it active), calculate it or create any new Lookup Rollup Summaries.
I am using the DLRS to show in the account object a summation of opportunties where a custom field isn’t blank. Do you know of a solution for the errors?
February 12, 2018 at 6:54 pm
What org type are you in? PE is not supported.
February 12, 2018 at 7:04 pm
I was able to resolve the issue. Dan Kludgy had me check to see if I had AuthorAlex permissions. I didn’t. Once I set that permission I was able to get it to work. So great! Thanks for creating this app! One thing I would love to see is a way to rollup a max for dates. It looks like it can only do max for numeric fields. Is that something you hope to create?
February 12, 2018 at 7:06 pm
Of course! Love it when the great community around this tool comes to the rescue! Great enhancement idea, log it on the GitHub Issues page please. Thanks!
February 12, 2018 at 7:14 pm
Done!
February 12, 2018 at 7:24 pm
Hi, please excuse me if I’m just ignorant or have missed reading this somewhere, but what do I need to do to get the latest version of the app? I installed it ages ago and just checked now – it’s still on v1.22.
February 13, 2018 at 6:32 pm
No problem. I do not do push upgrades. You have to go to the readme file and find the latest link to install/upgrade your package. Please review notes between the releases for post install steps. You can go straight to latest.
February 14, 2018 at 11:40 am
Excellent tool, saved my life more than once.
I have now a question: my need is to write Contact Id (the last created one) on its relative Account.
Can I do it by this tool without writing any apex trigger by myself?
I created a custom field (text) on which I am supposed to export the result ID: operation is LAST and Aggregate field would be Account on Contact; but it’s not working.
Any ideas?
Thanks again
March 9, 2018 at 9:24 pm
It’s hard to tell with out seeing more. Suggest you share some details on a GitHub issue or a Chatter post Per the group on the readme file
February 20, 2018 at 8:30 pm
Hello Andrew,
I have a question on “Schedule Recurring Calculate Job” page – rollupscheduledcalculate
we have options to select for: Min, Hour, Day of the month, month and Day of the week.
I have been trying to schedule a rollup job for every 5 min and have not managed to figure this out. It seems the lowest denominator is hourly. Is it not possible to do every 30 min or so?
February 21, 2018 at 8:38 am
Thad’s correct.
February 22, 2018 at 8:57 am
FYI the max function works with dates. I had read that it only worked for numeric fields. I will remove from GitHub Issues.
February 22, 2018 at 6:53 am
Hi Andrew,
I am trying to utilize this tool to count the number of records on a related list in a custom object. I named the parent object the custom object, the child object is accounts, and the related look up field is Referring Attorney. I want to count the number of distinct records in the related list on the custom object so I entered Name in the field to aggregate, and then added a custom field on the custom object is a number field for the aggregate result field. I have activated the summary and deployed the trigger for the child object.
Nothing is showing up in the custom field on the parent object. Is there something that I am missing here?
February 26, 2018 at 5:00 pm
Assuming it’s a real-time rollup, make sure the relationship criteria fields field is completed so the tool looks for the correct changes in child record edits. It’s hard to advise further with knowing your steps and expected results.
March 28, 2018 at 6:37 am
I’m struggling to implement an aggregation that I can do with SOQL but would like to use the declarative rollup tool for instead. Here is my use case:
– Fund is a child object of Account. Fund has 2 important attributes – Asset Class (picklist) and NAV (currency)
– For each Account, I need to sum the NAV for all Funds in each Asset Class, then display the Asset Class with the greatest NAV amount on the Account record.
Here is a SOQL query that works… can this query be implemented in the declarative tool?
SELECT AssetClass__c, Account, SUM(NAV__c) FROM Fund__c WHERE Account =’0012F00000BqTla’ GROUP BY AssetClass__c, Account ORDER BY SUM(NAV__c) DESC NULLS LAST LIMIT 1
March 28, 2018 at 6:41 am
Clarification on requirements:
For each Account, I need to sum the NAV for all Funds in each Asset Class, then display the Asset Class with the greatest SUM(NAV) on the Account record.
April 8, 2018 at 6:30 pm
So for each Asset class create a target field for the rollup for that asset on your Account object. Then define a rollup for each asset class. Then have a formula on Account that resolves the greatest value from the Asset class rollup fields on Account.
April 4, 2018 at 12:42 am
Hi Andrew,
Can I schedule the dlrs I’ve set up by running an Apex script?
Or this is available only via Schedule Calculate button?
April 8, 2018 at 6:26 pm
Sure you can use the Apex Schedule API or via the DLRS API (see RollupSevice) depending on the schedule mode you are using.
Pingback: A Declarative Rollup Summary Tool for Force.com Lookup Relationships | Developer Force Blog
August 13, 2018 at 6:01 am
Hi, for some reason only when I change the layout of Manage Lookup Rollup Summaries to Classic, I see all of the fields I previously insatlled? ?In the regular layout I can only see 5 of them…Why is that?
December 15, 2018 at 2:15 pm
Hmmm not sure… i am also a bit confused since the Manage Lookup ROllup Summaries page is a Visualforce page and not driven by Layouts…?
September 19, 2018 at 6:38 am
I believe this will be a perfect tool as I am trying to do almost an identical thing to Jenna Weiner (@RatherGeeky) with my opportunities however I am having issues with configuring the remote site settings due to my inexperience. When the instructions say
“Use the following URL, https://dlrs.eu2.visual.force.com (adjusting the instance part accordingly).”
Which part do I need to adjust? Our instance for Sandbox where I am playing is https://olincrm–full.cs66.my.salesforce.com but I don’t know what to keep and what to edit from the initial URL. I’m sure half the community is laughing but I’m that green on apps!
December 15, 2018 at 1:26 pm
No worries at all, everyone has to start some place! If you click the Welcome tab (select the tools app from the drop down or launching if in lightning) this will automate the process. Make sure you get the latest version from the README here .https://github.com/afawcett/declarative-lookup-rollup-summaries
September 24, 2018 at 2:31 am
I am getting error field does not exist.
I select Opportunity as parent and child and in Relationship field, i use a custom field Opportunity lookup(using to store name of parent opportunity)
Relationship Field: Field does not exist.
Field to Aggregate: Field does not exist.
Aggregate Result Field: Field does not exist.
September 24, 2018 at 3:04 am
Solved
August 7, 2020 at 2:10 am
please how did you solve this??
February 4, 2019 at 11:38 am
Can I use this app with Salesforce Lighting?
March 28, 2019 at 11:57 am
I am just starting off and I like the tool but I am having trouble. After my agents perform an activity they log it an ACTIVITY and relate it to the OPPORTUNITY or ACCOUNT. During the process they can log 1 of 6 activity types (e.g. call, email, meeting, etc). Will this tool help me count total calls, emails, etc, on the account level? If so, how?
Lastly, will it help me do it but only count activities performed in the last x number of days?
April 4, 2019 at 5:49 pm
It will do this, but because of your last requirement will have to be a full recalc scheduled job. Checkout the wiki section of the GitHub repo for an overview of the scheduled modes.
April 3, 2019 at 3:38 am
I created a customer field on Case to count the number of attachments. I used ParentID as the relationship field. It works when I add a new attachment but doesn’t seem to recognize previous attachments. For example I had an existing case with 2 attachments. When I run the calculate job my custom field returns a 0. When I add a new attachment, the custom field then returns 1. As if it recognizes the new attachment, but not the attachments that existed before I created the DLRS. Any ideas?
April 4, 2019 at 5:44 pm
Sharing maybe? Worth positing on the community Chatter group this feels like something others may have come across.
May 16, 2019 at 2:55 am
Andrew you must be one of the most popular guys in the Salesforce world. Thanks for your generosity in sharing this with us all. An ABSOLUTE life saver.
May 16, 2019 at 6:16 pm
Your very welcome and thank your for you kind words. 🙏🏻
May 16, 2019 at 2:57 am
Also now getting an error around currency:
Attempt to de-reference a null object Class.amc.CurrencyUtility.manageActionCurrencyBefore: line 287, column 1 Trigger.amc.UpdateStatus: line 34, column 1: [] Class.dlrs.RollupService.testHandler: line 282, column 1 Class.dlrs_amc_ActionTest.testTrigger: line 11, column 1
Any thoughts?
Still love it – we’re using this for multiple solutions.
May 16, 2019 at 6:20 pm
The test code generated is not aware of required (implicit or otherwise) fields in trigger code associated with the child object. This looks like a bug or unexpected null field value error in the amc packages trigger CurrencyUtility. Check out this article for more information https://github.com/afawcett/declarative-lookup-rollup-summaries/wiki/Challenges-with-Code-Coverage
May 22, 2019 at 12:30 pm
I set up DLRS for a client in their Sandbox, and it does not automatically calculate even though the calculation mode is set to realtime. This instance is using the Households installed package, and I’m rolling up the household members’ opportunities by record type. This managed package does not let you create custom rollup fields because, “this object is not the master in a master-detail relationship.” So that’s why I’m using DLRS. But I don’t know if the lack of a master relationship is why the automatic calculation does not work for DLRS. Is there a setting I need to turn on that I may have overlooked? I have 6 DLRS rollups so I don’t want to do it manually. I have scheduled them to run overnight, and they work that way.
June 15, 2019 at 4:40 pm
In realtime mode it will only calculated when the rollup is active, the child record is inserted, deleted or in the update case when one of the field being rolled up is changed or optionally any of the fields listed in the ‘relationship criteria fields’ field is changed. Hope this helps and sorry for the late reply. Andy.
June 24, 2019 at 7:49 am
Thanks for your reply. I have put a custom field from the child record in the “relationship criteria fields” field and it still doesn’t automatically update when that field is changed. Do I also have to include that same field in the “relationship criteria” field? I have a screen print of the roll-up summary but can’t include it in the comments.
July 4, 2019 at 10:34 am
Is the rollup active? Sorry to ask a basic question, if I have forgot this in the past.
July 8, 2019 at 7:24 am
Yes it’s active. Right now the only way to get it to work is to schedule it.
September 2, 2019 at 8:18 am
This is really strange, what do the debug logs show?
May 28, 2019 at 7:20 am
Hi Andrew,
Your tool is amazing!
I’m currently testing in my Sandbox.
My question is as follow:
How can i have the Rollup in the “Aggregate Result Field” update automatically when there is a change in the child objects “Relationship Criteria”?
Looking forward to your response!
Can’t wait to implement!
June 15, 2019 at 4:34 pm
Thank you! You should list the fields in the “Relationship Criteria Fields” field that you want the tool to monitor for changes, including those in formula fields used in the relationship criteria. You can only list immediate child fields however. There are some workarounds shared in my blog if you have fields you want to monitor on related records to the child records. Not sure if this is your case. Andy.
November 18, 2019 at 11:16 am
Hello Andrew,
Been using this tool for a bit now, and it is really good. However, I just came across a requirement that I am having trouble getting set up. So I use a concatenation field for a few fields on a child object (for example – invoice ID, invoice doc date, invoice amount), then use the rollup tool to display a list of these concatenated fields in one text field on the parent object. I recently added a checkbox to show which child records have been “resolved”. So I only want the child records to roll up into the parent field (that displays the list of all child records) where resolved = FALSE.
But I am having a rough time trying to use the “Relationship Criteria” and “Relationship Criteria Fields”. I am able to add my “Resolved__c” field to the “Relationship Criteria Fields” field, but am not able to add any criteria to the “Relationship Criteria” field. As I said, I put “Resolved__c” in the Relationship Criteria Fields field, and it saved ok. Then I tried the following in the “Relationship Criteria” field:
1. Resolved__c = 0
2. Resolved__c = FALSE
3. Resolved__c = “0” (as well as ‘0’)
4. Resolved__c = “FALSE” (as well as ‘FALSE’)
5. 0
6. “0”
7. ‘0’
8. “FALSE”
9. ‘FALSE’
I keep getting an error that directs me to “https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm” – but I have no knowledge on SOQL and I am not really understanding how I need to go about this.
Is it even possible?
Thanks,
Mike
November 28, 2022 at 10:15 pm
Sorry for not responding sooner. The best place to get support from community is listed here https://github.com/SFDO-Community/declarative-lookup-rollup-summaries#questions-and-community-support.Thanks.
November 25, 2019 at 3:31 pm
Hello Andrew,
We have been using this tool since 2015, now we have apttus, salesforce on the same instance. The problem is that now we are getting time out issue because on Opp line item dlrs gets triggered for delete, create, update.
Can I use calculation mode as developer and from my custom trigger on Opp line item I can call dlrs.RollupService.triggerHandler() ?
December 28, 2019 at 7:29 pm
Yep you sure can! 👍🏻
December 19, 2019 at 7:18 pm
How do I deploy this from sandbox to production? we have to test all the functions in the sandbox, so there are a few of rollup summaries created in sandbox, now we would like to deploy them in the production!
Thanks
December 28, 2019 at 7:53 pm
Sure just use the Manage Rollup Summaries Tab to create and configure and then when ready use change set and make sure to include the custom Metadada type and apex triggers.
July 28, 2021 at 2:37 pm
Do I need to re-install the production version of the tool in the production org, before deployment via change set, Or can I just deploy the full package from Sandbox to production org as well?
October 9, 2021 at 9:41 am
If the installed package versions match – no need to reinstall.
March 6, 2021 at 10:05 am
Is there a fix for the API error?
ERROR
Errors
Unable to connect to the Salesforce Metadata API.
This could be because it is the first time installing this tool or your Salesforce domain has changed.
A Remote Site Setting must be created or updated in your org before you can use this tool.
Press the Create Remote Site Setting button to perform this step or refer to the post install step below to perform this manually.
I have let the Create Remote Site Setting button create the Remote Site Setting, and I have done it manually. Using versions 2.11 and 2.12, but I still get the same error (it works in the sandbox though)…
March 27, 2021 at 10:38 am
I think there is a problem with the url it generates – can you check the domain in your production org with the domain in the url used to create the remote site – you should be able manually – I will try to further investigate this meanwhile.