SFDO-Community / declarative-lookup-rollup-summaries

Declarative Lookup Rollup Summaries (DLRS) is a community built and maintained Salesforce application that allows you to create cross object roll-ups declaratively - no code! For install instructions and documentation, visit our website https://sfdo-community-sprints.github.io/DLRS-Documentation/

Home Page:https://sfdo-community-sprints.github.io/DLRS-Documentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Null Pointer Exception

wes1278 opened this issue · comments

Hey Andrew,

First, this is an awesome tool!! Thanks so much for putting time into this. I'm running into a null pointer exception that I can't seem to get around. Here is the anticlimactic error message:

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger dlrs_Rep_CodeTrigger caused an unexpected exception, contact your administrator: dlrs_Rep_CodeTrigger: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: (dlrs)".

Quick object description:
Account
Contact | Team__c (is master-detail to Account)
Rep_Code__c (has a lookup to Contact, and a lookup to Team__c object)
Asset__c (is master-detail to rep_code__c object)

There is a rollup summary from asset__c to Rep_code__c to sum a currency field on asset__c. Then there is a workflow field update on rep_code__c to copy data from the RUS to a normal currency field called AUM__c on the Rep_Code__c object. Then I have 2 records in your dlrs__LookupRollupSummary__c object to rollup the AUM__c field on Rep_Code__c to the contact or team records (based on a type__c field).
Here are those records:
image

I read a few of your other issues on here and some people said they had issues with the relationship criteria; Ideally, I'd like to have "Type__c='Team'" in the rollup summary detail but it errors with or without it.

Any ideas on what is going on here? It works for the contacts, but not for the team records.

I have a dev sandbox you can use to repro this is if you want access, just let me know.

Thanks!
-Wes

Ok, I've found your Developer Edition org under my Subscriber Support tab, it would be great if you enabled Support Access and provide some steps to recreate. I should be able to get a complete stack dump from the error above and narrow down the line of code causing the issue.

Hey Andrew,

I've granted you as lengthy an access period as I could. To reproduce, go and find an Asset__c record (not the standard sfdc object) and change the value. You'll get the exception.

Then, you can inactivate the "Rollup AUM for Teams" lookup rollup summary detail record and try your same operation over again, it will work.

Thanks!

BTW, I was curious if you were interested in having a nice front-end page that does get describes n such for creating these records instead of solely relying on the triggers you've got in place. That's something I'd be interested in contributing if you find value.

Thanks, will take a look over the weekend.

Oh and yes, absolutely see value in a front-end page! Your more than welcome to collaborate on this, thats why its open source. Do you want me to add you as a collaborator on the project or work in your own fork and issue a pull request when your done? Either works for me, let me know and thanks again! 👍

I'll fork it. :) Thanks for offering to look into that exception.

Thanks for the access, i reproduced it in a test and fixed it, see the Readme for the Install URL for v1.7 of the package.

THANKS!!!! works like a charm! :)