Andrew Fawcett
Independent Salesforce Consultant | Former CPO, Heroku (Salesforce) | CTO, FinancialForce.com.
I started this blog to share some thoughts, ideas and opinions around my main passion in life computing, or more specifically these days Cloud computing. Who knows maybe I’ll go stray now and again into some of my others as well!
I’m an independent Salesforce consultant, architect, and open-source contributor with a deep focus on Salesforce platform development, Heroku integrations, and emerging AI patterns like agentic architectures. Previously VP of Product Management and Heroku CPO at Salesforce, I helped shape core platform strategy and led developer-focused initiatives across teams. My passion for architecture and building with developers led to the creation of AndyInTheCloud, the DLRS open-source tool, Apex tools and frameworks, and a authored book on enterprise architecture for the Salesforce Platform.
I’m now working with organizations on:
– Salesforce and Heroku architecture and scale strategy
– AI-enhanced workflows (Agentforce, LangChain integrations)
– Salesforce Platform feature enablement, org health and codebase mentoring
– ISV and product advisory
I also continue to contribute to open source, blog regularly, and speak at Salesforce community and dev events. Let’s connect if you’re exploring something in the Salesforce dev space, or if you’re looking for a strategic partner on your next platform challenge.
Any views expressed on this blog are entirely my own.
Please find me on Twitter @andyinthecloud, LinkedIn or post a comment on a specific blog post.
IMPORTANT NOTE: Declarative Lookup Rollup Summary (DLRS) Tool:
This tool is open source and is supported by the community in a volunteer capacity. Kindly please post your questions to the Trailblazer Community Group. Thank you!
January 31, 2017 at 2:23 pm
Hello, I’m having trouble using Declarative Lookup on salesforce. How could I get in touch?
February 16, 2017 at 1:58 am
Take a look at the chatter community group linked in the readme file https://github.com/afawcett/declarative-lookup-rollup-summaries
May 3, 2017 at 6:03 pm
The Declarative Rollup looks great, is it free to use?
May 6, 2017 at 2:03 am
Yes, its open source and community supported.
July 10, 2017 at 4:31 pm
Hi Andrew, I have a requirement where i need to develop a VF page through which i am able to create queue. So i can have functionality where user can create queue without having access to access to setup area and other permissions.
Is there anyway to create custom queue page. Can you provide me some directions on same and if there is any other useful info related to it.
July 11, 2017 at 5:02 am
You should be able to use regular dml to create a Group setting it’s type to Queue. Apex runs in system mode so you should be able to do this without setup access. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_group.htm
August 16, 2017 at 12:51 am
I’m trying to download Declarative Lookup but am getting message that the package has been deprecated and can no longer be installed. Saying I should try installing a newer version or contact the package owner. Is there another version available and if so, how do I get a copy?
August 17, 2017 at 12:25 am
Go to the readme file and take the latest package link
August 17, 2017 at 11:47 pm
I’m loading it for app exchange and I don’t see any readme file. can you give me further instructions please?
August 24, 2017 at 12:28 am
https://github.com/afawcett/declarative-lookup-rollup-summaries/blob/master/README.markdown
August 24, 2017 at 12:45 am
Thank you, Andy.
August 17, 2017 at 11:57 pm
that should have said- from app exchange, not – for app exchange
August 22, 2017 at 4:47 pm
I keep getting an error in my Relationship Criteria. I’m trying to calculate the AMOUNT of closed won opportunities YTD and for previous years (i,e., 01-01-2016 to 12-31-2016). FOr YTD, my criteria: StageName = Closed Won AND CloseDate >= 01-01-2017
The error: Error: Relationship Criteria ‘StageName = Closed Won, CloseDate >= 01-01-2017’ is not valid, see SOQL documentation http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_conditionexpression.htm, error is ‘expecting a colon, found ‘Closed”
August 24, 2017 at 1:00 am
You need single quotes around the Closed Won
August 25, 2017 at 7:23 am
Hi Andrew , I want to automate a report generation process :
Report : we need to create a report containing Notes created for each lead in a month.
What we do Manually:
We query the data in two way : First we query all the required filed from the the Lead object . Secondly, we query notes record using lead Id as parent Id. Then we consolidate the data in Excel sheet . there is one row per Notes. Means Same lead can have 10 row in Excel if the 10 Notes have been created in a Month.
For Automating :
1. Created Custom controller.
2. Fetch the record using inner query.
3. Created a wrapper class according to the fields of Notes and Lead required in each row .
4 Populated the data in wrapper class list.
5. Then I created a visualforce page ( that will call the action in controller returning the list .
6. Finally I am calling this Visualforce in a scheduler which return the data .
But rows can be more 10000 or more . So I am getting String too large or more than 60k ..
August 25, 2017 at 7:28 am
I used this in page attribute : contenttype=”application/vnd.ms-excel#{!fileName}.xls” Page Name : AgentDealerFollowup
I am using below code in scheduler :
Datetime myDatetime = Datetime.now();
String myDatetimeStr = myDatetime.format(‘ MMMM,yyyy’);
EmailTemplate et = [SELECT id FROM EmailTemplate WHERE name = ‘Monthly Dealer Report Template’];
Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment();
ApexPages.PageReference report = new ApexPages.PageReference(‘/apex/AgentDealerFollowup’);
attachment.setFileName(‘Agent Dealer Follow up’+ myDatetimeStr + ‘.xls’);
attachment.setBody(Blob.valueof(report.getContent().toString()));
//attachment.setContentType(‘text/csv’);
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
message.setFileAttachments(new Messaging.EmailFileAttachment[] { attachment } );
// message.setSubject(‘Report’);
August 26, 2017 at 9:29 pm
Try readOnly mode for your Visualforce page, it’s an attribute
October 3, 2017 at 11:58 am
Hi Andrew, I’m trying to deploy DouglasCAyers/sfdc-reloadable-visualforce-lightning-component to my salesforce sandbox and I’m getting the following error: “Failures: pages/DemoAccountFlowPage.page(DemoAccountFlowPage):The specified Package Version number does not exist for that Package: dlrs, 2.8.” It says deployment complete but I don’t see the custom component. Any help would be useful I’m anxious to get this working in my org and it would help a lot. P.S I’m not familiar with the processes in Github Thanks!
October 3, 2017 at 3:05 pm
Doug has inadvertently captured this reference when uploading his code from his org (which must have dlrs in it). Ask him to remove it, maybe other references but this is the one your refer to https://github.com/DouglasCAyers/sfdc-reloadable-visualforce-lightning-component/blob/master/src/pages/DemoAccountFlowPage.page-meta.xml
October 4, 2017 at 6:20 am
Thanks Andrew, I went ahead and created the components manually. Thanks again for the tremendous resource!
October 9, 2017 at 2:01 am
Him Andrew, I bought your book and I think is amazing. Just to tell you that on page 59, indicates that Data Replication is a REST API, and I think it is just SOAP.
Again, thanks a million for writing such an amazing book.
October 9, 2017 at 3:35 pm
Thanks! 👍🏻
October 29, 2017 at 2:56 pm
Hi Andy,
I have had some great success with DLRS for my clients. I would like to do a webinar for them and show them how it might help them with some of their problems.
I like to check in with authors before presenting their material.
Please let me know if this is OK with you.
Thanks… Bob
October 29, 2017 at 3:31 pm
Totally fine Bob! Tweet me your webinar details and I will retweet to help promote 🙂
October 30, 2017 at 4:44 am
Hi Andrew, following along with your amazing book and blogging myself about Salesforce Connect (https://salesforcegraells.wordpress.com/2017/10/30/salesforce-connect-amazon-rds-odata/) I read on page 76 that External Objects has some limitations on Reporting. As those limitations are not detailed, if those were related to the blog entry made by Mark Kovacevich (https://developer.salesforce.com/blogs/engineering/2016/02/salesforce-connect-reporting.html) on Feb 2016, it is very satisfying to know that they were superseded with new functionality on Winter 17 (http://www.odata.org/blog/Webinar-on-Salesforce-Connect-External-Object-Reporting/).
Probably you wrote about other limitations, but just in case where those that were present on Mark’s article, I’d like to point it out.
Again, thank you so much for what a wonderful book and blog.
October 30, 2017 at 1:02 pm
Thank you for sharing, glad you liked the book! Yes that was new after it went to press. If you could leave a review that would be awesome, no worries if not. 👍🏻
October 30, 2017 at 1:32 pm
Of course, where would you like me to write the review? I bought the book on Packt.
November 1, 2017 at 5:36 pm
Amazon would be great, thanks! 👍🏻
October 31, 2017 at 3:36 am
Hey Andy, I’m working on a project that uses the fflib architecture. We’ve been debating about whether or not trigger logic should be allowed call out to service classes. On one hand, it is an easy way to satisfy business rules such as ‘after on close of ProductOne, call ProductTwoService.activate()’. On the other hand it seems wrong for domain logic to call out to services.
I guess ideally the structure would be:
ProductOneService.close(productOnes) {
new ProductOne(productOnes).close();
ProductTwoService.close([select related productTwos]);
}
Would you recommend treating these sorts of updates as an implied service call? Or should the product be structured in a way that the only way to perform certain updates is via a service call?
Thanks for any feedback! Love your work.
John
November 25, 2017 at 6:45 pm
Hey John, i think… i recall responding to a question like this before? Sometimes duplicate comments get posted so wanted to check. Did you get a response from me on this?
March 19, 2018 at 2:17 pm
Hey Andy, a colleague and I were just having another discussion about this & I pulled up this post and saw that you had replied! I must have forgotten to tick the notification boxes and so missed your response.
No, I haven’t received a response from you on this, but I’d love some advice. What criteria do you use to draw the line between ‘trigger logic’ and ‘not trigger logic’? I struggle sometimes between the convenience of a trigger and the greater readability of leaving logic outside of the trigger.
April 8, 2018 at 6:36 pm
Service logic orchestrations tasks, that span multiple objects, often multiple queries and multiple updates, kind of like the conductor in a band. Trigger/Domain logic focuses on the integrity of your data, validation, defaulting etc. Some folks like to start processes from triggers so sometimes call the service layer from the that. I know there are sometimes no elegant altertnatives without creating a new UI, but i do regard that as a bit of an an anti-pattern. These days we have many more ways to customize the native UI, custom actions, components etc. these controllers can invoke the service.
November 14, 2017 at 9:30 am
Hi Andy ,
I am facing issue on Test class for Meta ServiceExample Class.
I unable to get any wayout for this.
Can you please help me
November 14, 2017 at 1:31 pm
Sure. Tell me more.
November 14, 2017 at 9:37 am
Hi Andy ,
Congratulations….Commendable work by you
I am New to metadata Api . I have used your Code for The same and modified accordingly but i am not able to Run test class for it.
Can you help me with the test class?
I have raised an issue on The GITHUB. Please help me with the Issue
(https://github.com/financialforcedev/apex-mdapi/issues/193)
Please help me with this
November 14, 2017 at 1:30 pm
Thanks! I need more information to help you. What steps are you performing, any errors seen and your goal?
November 21, 2017 at 8:56 am
Hi Andrew
Thanks for sharing your work and incredible articles. It really helps.
I am trying to generate the latest Tooling API class using Tooling API wsdl download from Setup > Develop > API.
It generate multiple classes….
The Tooling API class here in this article is a single class.
https://github.com/afawcett/apex-toolingapi
Could you please guide how can i generate it.
November 21, 2017 at 4:03 pm
It was hand written mostly unfortunately
December 8, 2017 at 9:57 am
Hi Andy, I am getting the error message “This Remote Site Name already exists or has been previously used. Please choose a different name.”. If I delete that Remote Site and re-create it, will this affect any existing roll up summaries?
December 9, 2017 at 3:53 pm
No, not at all, it’s only used when configuring them
December 10, 2017 at 1:57 pm
Great, thanks so much!
December 10, 2017 at 3:54 pm
Hi Andy, I have come across another issue. I updated to the most recent release (in an org that had previously installed it in 2014). In the Aggregate Operation field, all of the “concatenate” options, as well as First and Last, are missing from the picklist. I tried simply adding the picklist value, though I assumed that that wouldn’t work, and it did not. Is there something else that I need to do to get the Concatenate functionality? Thanks again!
December 28, 2017 at 11:00 pm
Yes you need to add these. Double check the Readme release notes. I cannot recall the release, but if you scroll back through the release announcements you will see where I originally stated what you need to do in upgrading to the release that added these options.
December 19, 2017 at 3:11 pm
Hi Andrew – thanks so much for writing and posting this code. Awesome. Took me a few hours to create some list views but worked like a charm. Thanks so much!
January 30, 2018 at 9:42 am
Hey Andrew. Your tools are amazing. I was wondering if I could ask you if there is a way to gather ‘consecutive’ records in the declarative lookup rollup summaries. I.e. if an account has 4 contacts named Noah Matt Noah Noah Matt created in that order, I could do a summary of contact records with a filter for Name = Noah, and that would show that Noah had come in twice in a row.
If you have any ideas around this or how I might accomplish it that would be great.
January 30, 2018 at 7:03 pm
You can try the Concatenate operation and the field on the rollup to order the results. Thanks!
February 25, 2018 at 8:12 pm
Great work Andrew…
We have installed DLRS managed package and scheduled some rollups, having same child object.
Sometime it gives exception “UNABLE_TO_LOCK_ROW”.
Guide us on this.
February 26, 2018 at 4:58 pm
Adjust the schedule to avoid overlap or if possible criteria. It’s a platform error to avoid inconsistent data. Review the wiki page on scheduling I added some notes at he weekend re retry logic.
March 9, 2018 at 4:23 am
Hi I am trying to contact you and your telephone number isn’t working. I need to speak to you about your app that has been installed in our salesforce by the consultant who configured it. I have spoken to salesforce premier support and they need me to talk to you so you can log a case with them?
Can you call me asap or email me a correct number?
Thanks
March 9, 2018 at 9:22 pm
Sure what is your email?
March 20, 2018 at 3:53 am
Hi Andrew,
Hoping you can help. I’ve been running into an issue with Lookup Roll Calculate Jobs for a while, and I still haven’t managed to find a solution. I’m experincing the error “A calculate job for rollup ‘x’ is already executing.”. Sure enough, there are jobs which have failed to complete for whatever reason which I have to delete manually, however this is intermittent, sometimes all jobs will complete no issue, other times they will stumble and fail with that error. I have updated to 2.11 as I read this was a known issue prior to 2.8, but still the issue persists.
Is there anything you can advise?
Thanks, Jarrod.
March 20, 2018 at 4:54 pm
Yes I am getting reports the fix is not always working. I have some more detail from another user. I will try to see what’s going on this weekend. Can you message my AndyInTheCloud user in Salesforce Community with your email and details if I need to reach out.
April 10, 2018 at 8:26 am
Hi Andrew,
Hoping you can be of assistance.
I’m facing an issue whereby, if a record suddenly falls outside of the rollup criteria scope, historical field values are blanked out?
So for example, one of my criterias is that the record data is within last 30 days. The rollup works fine, aslong as the date is within the last 30 days, but as soon as it falls outside of that date, the aggregate field is blanked.
Is there a way to keep this data persistent historically?
thanks
April 16, 2018 at 5:38 pm
No, but you could have a workflow rule copy it over to another field but only when there is a value and it’s changed. Then use this field on your layouts, reports etc
June 25, 2018 at 4:57 pm
Hi Andrew, I am trying the GitHub SF deploy tool. Which is great tool. I am getting OATH error after click on allow. I land on your page but it just says oops something went wrong.. It gives me no further information. I am trying to connect to a sandbox which has a custom URL instead of test.salesforce.com. I also tried the same with my Developer Org which also has a custom URL. In both cases I am getting some error as mentioned above. Can you please check and help?
December 15, 2018 at 2:25 pm
Thanks i am also getting some reports of issues. I will do some test asap. Thanks for leeting me know.
June 28, 2018 at 10:39 am
Hello Andrew,
My org. installed Declarative Lookup Rollup Summaries Tool in 2017. I guess we have a field called “Contact Spend this Year” which will rollup all the opportunity Amount to the contact. Now business requirement is to change the fields and criteria. as its a managed package; i dont know where to make the necessary changes. Can you please help me on this.
Thanks,
Rakesh
December 15, 2018 at 2:24 pm
This tool is declaratively driven which means that you can change such things with clicks not code! Find the Declarative Rollup Summaries app in your drop down (classic UI) or launcher (lightning UI). Then first check the Manage Rollup Summaries tab for the rollup, if not check the Lookup Rollup Summaries tab for it. Hopefully whoever configured the tool in 2017 used obvious names / descriptions. If not focus on the Parent and Child fields to locate and obviously check the Relationship Criteria field on the rollup definition matches your current expectations of how it works. If you run into problems the Chatter Community Group for the tool is full folks who can help as well. https://github.com/afawcett/declarative-lookup-rollup-summaries (see README for group link).
July 6, 2018 at 5:11 am
Is there a sandbox version of the Declarative Rollup Summary Tool? We have to test all new packages in a non-production environment here.
July 14, 2018 at 4:39 pm
Yes sure, just use the applicable link from the GitHu README package install section.
July 15, 2018 at 9:49 am
Thank you
August 8, 2018 at 12:24 pm
Having a problem with DLRS on Salesforce. Is there a support person I can talk with?
August 8, 2018 at 5:07 pm
It is an open source project. It is supported by the community. Post your query in the community Chatter group linked from the readme file in the repo. There are some fine folks always happy to help.
August 8, 2018 at 5:43 pm
New to this. What is the readme file in the repo? Does your answer mean other users answer my question vs. someone from andyinthecloud?
August 8, 2018 at 6:39 pm
Here you go https://github.com/afawcett/declarative-lookup-rollup-summaries/blob/master/README.markdown and yes it’s a community driven product. Andyinthecloud is just me, not a company. I try to answer questions as well when I can.
October 9, 2018 at 12:06 am
Hi Andrew,
I am a new SF developer, bought your enterprise architecture book, liked it very much, especially the separation of concerns, unit test sections.
Though I have only been in SF for a short period of time, when I read those sections, “exactly that is my pain point!” comes often in my mind.
Do you think if i could have the honor to invite you once as the guest of my salesforce developer podcast show (http://salesforceway.com)?
Thanks for your excellent book and knowledge sharing!
Br,
Xi
December 15, 2018 at 1:05 pm
I would be totally honored to do this. Contact me via DM on Twitter and we can arrange some time to chat about it. Thank you!
October 27, 2018 at 11:09 am
Hi Andrew, I want to do a DLRS rollup summary on a rollup summary field. I gave this a quick test and it seemed to work fine but we’ve a big expansion phase coming up and people in my organisation are worried it might cause problems. Can you confirm that everything should work alright?
December 15, 2018 at 12:57 pm
Thats quite a wide open question tbh not having enough details its hard to given you a steer. Its a very powerful tool thats easy to use so i have seen some folks create way to many rollups when say reports or dashboards could be an altnerative then making the system do the work on every edit. You should also check out the wiki page for the tool that talks about using schedule mode, again i think sometimes when real time rollups are less important this can be used. So if you plan to do a lot of rollups plan the options you are going to take. Hope this helps.
October 30, 2018 at 8:59 am
Hi Andy. my organisation would like to use DLRS for their rollups. They’ve got a big expansion phase coming up and are worried that a roll-up on a roll-up field might not update probably. Is it fine to make a rollup on a roll-up field?
December 15, 2018 at 12:47 pm
If you use the Realtime mode this should be ok, as one will trigger the other. Where it gets complex is if you have to switch to the differed/schedule mode for some rollups as their is no way currently of defining the dependency between rollups. If you do need to mix i would only use the scheduled mode for your top-level rollups and make child ones realtime. Hope this helps.
November 22, 2018 at 2:55 am
Hi Andy,
Looking at some of your projects, I see you make use of many inner classes, for example in the MetadataService class. I have a feeling this is being done because of the lack of namespaces/packages in Apex, but at the same time, I feel it gives the outer class too many responsibilities, and some would argue that this violates the SRP.
Could you please share some thoughts on this? I’m currently struggling with my code base due to the namespaces/packages limitation and I’m wondering if using inner classes the way you are using them, would help me.
Thanks!
December 15, 2018 at 12:25 pm
Yes that is a good observation and yes that is sometimes the reason. In terms of SRP, if the Outer class is really just a makeshift namespace with no features of its own, its not so bad, but of course it makes the class file large. The other thing that can be done is a prefix, e.g. fflib_, di_ etc. It’s ugly I know. One recent thought i had was a hybrid of the two, whereby the private/impl classes used a prefix and the ones designed for mainstream use got housed in a class with inner classes mostly delegating to the prefixed classes. Kind of like a public/private api style? As i say i’ve not really tried this out much. For me the main thing to watch is Unlocked Packages support Namespaces, see here for more thoughts https://andyinthecloud.com/2018/06/16/salesforce-dx-packages-and-open-source/
December 13, 2018 at 10:27 am
Hi Andy,
I am trying to reach you from few days regarding usage of apex common library. I am also reading your book edition 2 and it’s really helpful. Thank you very much
We have a existing salesforce implementation, we have most of the login in triggers and trigger handlers. We are still using classic and no mobile or other UI.
1. We have huge amount of logic in trigger handlers, once we refactored this in selector, domain, service and uow. We still have large amount of code in domain classes. We wrote some helper classes with public methods. Is there any other better pattern to refactor domain classes that are huge.
eg. we have 30 field validations and 20 field defaults and the field defaults. Related object updates etc.
2. We have default fields on before update event too, for this I extended the domain base class with this method, I know this is not upgrade safe. Is there a better option ?
public virtual void onApplyDefaults(Map existingRecords) { }
3. We have custom setting to to turn on and off triggers. for now it seems we need to write extra line of code in the trigger. is there any other better option for this ?
if(customsetting){
domainclass.getTriggerEvent(YourDomain.class).disableAll()
}
call domainclass here
December 13, 2018 at 10:40 am
I also added the same question here
https://github.com/financialforcedev/fflib-apex-common/issues/210
December 15, 2018 at 11:53 am
Hello! Sorry for the late response.
RE: 1, helper classes are good, but I would also consider domain base classes per the chapter in my book this can help you group shared logic between certain objects that have similar behaviors. You can use virtual or abstract methods in your own base classes much like the fflib_SObjectDomain to allow extension classes to customize your base classes behavior if need. You may also consider splitting groups of field validations into separate classes that implement a standard interface (e.g. IFieldValidator.validate) that can be used by the domain class to build a list of applicable validations based fields that have changed then execute them. This also helps with performance. Be careful though with SOQL/DML done in such classes, try to pass in the required state if possible to the validators.
RE: 2, yes that does appear to be a missing feature. Meanwhile to make to avoid editing the base try public override void handleBeforeUpdate(Map existingRecords) { onApplyDefaults(existingRecords); onBeforeUpdate(existingRecords);}
RE: 3, you could put this in the inner domain class constructor class at the bottom of your domain class perhaps? To encapsulate it better. Though if you are disabling all events it’s arguably more efficient to just by-pass the domain handler in the trigger code completely. if(customsetting){
domainclass.getTriggerEvent(YourDomain.class).disableAll()
} else { call domainclass here }
Hope this helps!
February 14, 2019 at 2:14 pm
Hi Andy, I am using the apex-mdapi to update a custom label in Apex. Is there a way to check that it has been correctly changed before proceeding?
April 4, 2019 at 6:10 pm
If you use the updateMetadafa method a valid success status should be enough
February 27, 2019 at 4:25 pm
Hi Andy!
I have your app installed but unfortunately our IT team has asked that I uninstall and I’m having issues removing it. Salesforce support said that the issue is that I have lost the API connection but your app is recognizing that our site name is/was already connected. He recommended that I ask if our domain could be removed from your list. Is this something that you can help with? If not can you tell me what to do to re-establish the connection? Thanks!
February 27, 2019 at 4:38 pm
Sure, what error are you getting from the manage child triggers page?
April 15, 2019 at 12:01 pm
Hi Andy,
I’m using DLRS and it’s been working well! Except, I just ran into an issue when trying to deploy a DLRS roll-up field on a custom object in Production. I get an error that the test coverage is 0 %. I first created and deployed the field in a fullcopy Sandbox and it worked perfectly. But now in Production, I re-created the DLRS field from scratch, and when it was deployed, it failed. Here’s the error message displayed:
Warning:dlrs_AdvisingTrigger:Test coverage of selected Apex Trigger is 0%, at least 75% test coverage is required
Error:dlrs_AdvisingTest.testTrigger System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Advising: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Class.AdvisingTriggerHandler.SetAffiliation: line 79, column 1 Trigger.Advising: line 8, column 1: [] Class.dlrs.RollupService.testHandler: line 282, column 1 Class.dlrs_AdvisingTest.testTrigger: line 11, column 1
Please advise
April 27, 2019 at 7:07 am
It looks like a bug in the trigger code for that object. See line 8 AdvisingTriggerHandler. Also have a read through this https://github.com/afawcett/declarative-lookup-rollup-summaries/wiki/Challenges-with-Code-Coverage
May 6, 2019 at 10:20 pm
Hi Andy,
I am using dlrs for our organisation’s database. Unfortunately we are getting this error:
ERROR: dlrs_ContactTrigger: System.LimitException: dlrs:Too many query rows: 50001
What is the workaround for this please?
Kind regards
Emma
May 9, 2019 at 11:27 pm
This is a platform limit and requires you to review your lookup filter criteria ideally you can reduce the records needed and/or move some rollups to schedule more. There is some details on the readme file about limitations and you can find information on schedule more on the GitHub wiki. Finally the readme has a link to a great chatter Group in the Community.
June 7, 2019 at 12:35 am
Hi Andy, I’m not a developer, but a mere mortal Salesforce functional administrator happily using DLRS. Until recently, that is. I suspect that something changed in Summer ’19. The Apex trigger for CampaignMember can’t be deployed anymore. I refreshed my installed package so that it’s back on status “passed”. This is the error message:
dlrs_CampaignMemberTest.testTrigger System.DmlException: Insert failed. First exception on row 0; first error: MALFORMED_ID, Invalid campaign id: null: [CampaignId] Class.dlrs.RollupService.testHandler: line 282, column 1 Class.dlrs_CampaignMemberTest.testTrigger: line 11, column 1
Here are my questions:
– Although the problem seems obvious (CampaignId field is not populated), I have no idea where to find this incorrect code, let alone change it. Can you tell me how to find it?
– Could this be a general bug in DLRS, not limited to my org?
– Is this blog the proper platform for my questions?
Thanks.
Eric Delahay
Tilburg University
Tilburg, The Netherlands
June 15, 2019 at 4:37 pm
No worries at all. Sorry for the late reply. Take a look at this… https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/356. This should help. Cheers!
June 20, 2019 at 5:16 am
Hello Andrew,
Four your information, I was not the one in charge of the DLRS setup 2 years ago.
When I try to send a bill, there is the following message :
“Error : Update failed. First exception on row 0 with id a0V1t00000FOURvEAP; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, dlrs_sofactoapp_Factures_clientTrigger: execution of AfterUpdate caused by: dlrs.RollupServiceException: Lookup Rollup Summary ‘CA Facturé pour opportunité’ is invalid, your org configuration may have changed. (dlrs) : []”
And when I try to delete a “rough” bill, there is this message :
“Validation Errors While Saving Record(s)
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was “Apex trigger dlrs_sofactoapp_Factures_clientTrigger caused an unexpected exception, contact your administrator: dlrs_sofactoapp_Factures_clientTrigger: execution of AfterDelete caused by: dlrs.RollupServiceException: Lookup Rollup Summary ‘CA Facturé pour opportunité’ is invalid, your org configuration may have changed.: (dlrs)”.”
The issues came out last week and I have not been aware of any org configuration changes. Do you have any suggestions about these issues ?
Thanks in advance,
Cédric Pagès
July 4, 2019 at 10:27 am
So this could be that one of the fields referenced on the rollup ca fracture pour opportunite has been renamed or deleted. Open that rollup summary and resave it and see if you get any errors.
July 11, 2019 at 2:43 pm
Hey Andy,
Thanks for the great tool dlrs and knowledge sharing on the blog. We are moving few things to change data capture in our org, was wondering if dlrs can be put on change event object, more like async apex triggers instead of direct trigger on object ?!
Hope you could shed some light on this.
Thanks
Prashant
September 2, 2019 at 8:11 am
Yes the dlrs api can be used this way. Great idea!
August 20, 2019 at 9:37 am
Hi, will Declarative Lookup Rollup Summaries Tool be updated for Lightning?
September 2, 2019 at 7:51 am
It works just fine in Lightning, but some improvements are staged for the next release.
October 4, 2019 at 8:26 am
Andy, I’ve been working with DLRS in my sandbox for a few weeks now and I think it has helped address a major need for the sales team! Unfortunately, since the app is no longer listed in the AppExchange I’m having a hard time convincing my security team that the code is safe and ‘vetted’ and can be deployed into production. Any suggestions? I’m admin certified but don’t know the first thing about code and we do not have any Salesforce developers on the team.
December 28, 2019 at 7:14 pm
The package was never actually on AppExchange I never got round to it. There is a note in the Readme about the last time it was security reviewed. Maybe show them that?
October 4, 2019 at 3:36 pm
Hi Andy,
We want to rollup from a single opportunity record type “donation” using your tool. When it was installed, the person who installed it set it so all of the “Amounts” from each opportunity record type are rolled up. I’m not sure what to do.
Thanks,
Mike
December 28, 2019 at 7:15 pm
Hi Mile. Can you post this on the tools chatter community group please. See link in the tools readme file on the repo. Thanks!
October 22, 2019 at 10:33 am
I am getting the following email daily and have no idea how to resolve it. This rollup was implemented prior to me being here and I am not a developer. Where can I get support for the Declarative Lookup Rollup Summaries Tool?
ApexApplication
12:07 PM (1 hour ago)
to me
Apex script unhandled trigger exception by user/organization: 0051M000005K05R/00DG0000000hirx
dlrs_ContactTrigger: execution of AfterUpdate
caused by: dlrs.fflib_QueryFactory.InvalidFieldException: Invalid field ‘CreatedDate’ for object ‘dlrs__LookupRollupSummary__c’
Class.dlrs.fflib_QueryFactory.getFieldPath: line 91, column 1
Class.dlrs.fflib_QueryFactory.addOrdering: line 543, column 1
Class.dlrs.fflib_SObjectSelector.configureQueryFactory: line 389, column 1
Class.dlrs.fflib_SObjectSelector.newQueryFactory: line 273, column 1
Class.dlrs.fflib_SObjectSelector.newQueryFactory: line 255, column 1
Class.dlrs.RollupSummariesSelector.CustomObjectSelector: line 165, column 1
Class.dlrs.RollupSummariesSelector: line 80, column 1
Class.dlrs.RollupService: line 1069, column 1
Class.dlrs.RollupService: line 750, column 1
Class.dlrs.RollupService.triggerHandler: line 329, column 1
Trigger.dlrs_ContactTrigger: line 7, column 1
December 28, 2019 at 7:21 pm
Can you join the discussion on this error on the github issue on the DLRS repo please. Interested in your use case and scenario for sure as we track this down. 👍🏻
November 13, 2019 at 9:52 am
Hi Andrew,
I’m a software engineer, but still learning SF.
I ran the Lightning Experience Configuration Converter (LECC) https://lightning-configuration.salesforce.com/
on my company’s partial sandbox and it identified a hard-coded URL in a VisualForce page that uses DLRS.
The LECC tool couldn’t auto-fix the URL. I tried to fix the URL using the Converter Guide’s instructions, but since the page belongs to an “installed managed package” the page is read-only for me.
If I open, edit, and try to save the ViewForce page, I get the error:
“Deployment Failed: Could not save : managed installed classes cannot be saved.”
How can I change the hard-coded URL to a relative URL in order to make my organization Lightning compliant?
The trailblazer community had no answers except what I already knew I could do (uninstall DLRS, fork your repo, change the URL, re-install the managed installed class). That is not ideal so they sent me to you.
Do you have any suggestions so that I can use your tool AND get the LECC to pass?
Thanks,
-Lucy
December 28, 2019 at 7:26 pm
I have a new version underway that might fix this. Meanwhile it’s safe to ignore I would say. It’s just the config setup pages which you will likely have done already. And it won’t effect your running rollups as they are not using browser code at all.
January 7, 2020 at 12:17 pm
Hi, I have DLRS working to concat distinct the User Ids of the Opportunity Team Members to a field on the parent Opportunity. When an Opportunity is created and the owner has a default Opportunity Team, the Opportunity Team child records are created, but the concat field on the Opportunity is not getting set. If I manually add another or remove a Team Member, it does then populate the concat field. I have it set to Realtime and System, it is Active and I did click Manage Child Trigger. I know I can use scheduling, but I am trying to avoid that. Any help would be appreciated.
January 7, 2020 at 1:29 pm
Default Team Support for Validation Rules and Apex Triggers
Validation rules and Apex triggers are supported when Lightning Experience users add their default team to an opportunity using the Add action on the related list. However, they’re not supported when Lightning Experience users select the personal settings option to add their default team automatically,
found my answer
April 16, 2020 at 12:18 pm
I NEED SOMEONE’S HELP. IS THERE ANY WAY TO CREATE ROLLUP ON A USER RECORD … WHEN USER IS A MANAGER, TO COUNT THE ACTIVE USERS FOR THE MANAGER –NOW …AT THE CURRENT POINT IN TIME THAT ANYONE IS LOOKING. I AM A SALESFORCE CONFIG SPECIALIST .. USED TO BE A CODER/DEVELOPER ….BUT NOT FOR YEARS. I KNOW OLD SQL. MY COMPANY, INOGEN, WE USE YOUR DECLARATIVE ROLLUP HELPER APP.
I DON’T UNDERSTAND WORDPRESS.
April 17, 2020 at 6:05 pm
Hi, try User object as parent and child and using the ManagerId field as the relationship. Have you read any of the docs on the readme for the tool or tried searching community chatter group (also linked in the readme on the tools repository). https://github.com/afawcett/declarative-lookup-rollup-summaries/blob/master/README.markdown#declarative-rollups-for-lookup-field-relationships
April 17, 2020 at 3:06 am
Firstly, thank you for the excellent Salesforce MetadataService.
I am primarily using it to dynamically modify Formula fields according to criteria selected by the end-user in a layout. Now I have been asked to provide these features as a plugin in SF AppEx.
Are there any copyright/rights issues (other the ones mentioned in the header of your code) if we use MetadataService within the Plugin?
April 17, 2020 at 5:57 pm
It uses bsd license, but not I am not longer the repo owner
April 18, 2020 at 3:44 am
Thank you Andrew for the clarification
April 23, 2020 at 5:35 am
Hi Andy. I am looking into btoh metadata and tooling api wrappers. Any reason why the Toooling API wrapper is stuck at APIv32? Any plan to release an update?
Is it easy to generate our own from the .wsdl?
Great work all around!
May 9, 2020 at 6:37 am
Yeah it’s just time really. The tooling api wrapper is based on rest api so does not have a generated form – it went this way as I recall because the rest api supporting more than one record per request. So it’s a case of adding new types or fields as needed.
June 26, 2020 at 12:48 pm
Hey Andy – Is DLRS HIPPA compliant?
July 20, 2020 at 9:07 am
I am not deeply familiar with that standard – i can say that DLRS is a 100% native application – so in that sense perhaps falls under the general platform HIPPA status?
July 5, 2020 at 3:49 am
Andy,
I am a super fan of your book (Salesforce Lightning Platform Enterprise Architecture), finished reading both 2nd & 3rd versions, This is a one stop book to learn all SFDC concepts with a practical business application. Thanks for your great work and deep knowledge in Salesforce.
I have a integration requirement where User should be provided a File-upload screen to send 3 excel files (each file have different template), ,need to parse the file and validate all cell records and send the data via json to external Rest API via Apex server layer, the external system Rest API will store all these records in tables, since we are not going to store these records in SFDC tables, Need your suggestions on the technical approach or the flow from client component to SFDC server layer and then to External Rest API calls, SFDC server layer is required for security reasons, as external system REST API will be exposed only to Salesforce server.
Need to consider batches (as files are 3MB avg 40K records approx), audit history and failure retry), if one batch is failed,
need to rollback all the batches and External system Rest API will use UPSERT command.
Please share your suggestions to plan a technical flow.
July 20, 2020 at 9:10 am
Thanks so much for your kind words. Have you see this older blog series? https://andyinthecloud.com/2012/11/04/handling-office-files-and-zip-files-in-apex-part-1/ – Does it help I wonder?
July 20, 2020 at 9:11 am
I would focus on staging the information in salesforce custom objects at least – use the above approach to access the information – export required info to a staging cusotm object where you can have status, audit etc. then havve a separate apex service that processes the staged information.
July 20, 2020 at 9:12 am
Maybe have a header staging object that gets updated when all the information is exported to its child records – then have a CDC / Apex Aysnc Trigger on that that fires the external intergration?
July 16, 2020 at 12:37 am
Hi Andrew,
Is there any support team to reach out as we are facing an issue in the DLRS package.
July 20, 2020 at 9:12 am
The best place to reach out for support is the thriving community chatter group linked at the top of the README file for the tool. ANdy.