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/
https://sfdo-community-sprints.github.io/DLRS-Documentation/
BSD 3-Clause "New" or "Revised" License
689 stars 235 forks source link

Apex error when updating Account after installation #48

Closed joshh347 closed 10 years ago

joshh347 commented 10 years ago

I installed a couple rollups (one on Accounts and another on Opportunitites) and deployed the Apex code for real-time updates. Now when a user tries to update various fields on an Account they are getting the following error:

Error: Invalid Data. Review all error messages below to correct your data. Apex trigger dlrs_AccountTrigger caused an unexpected exception, contact your administrator: dlrs_AccountTrigger: execution of AfterUpdate caused by: System.QueryException: unexpected token: ,: (dlrs) 2014-07-01_1704

wes1278 commented 10 years ago

Hello,

Can you provide a screenshot (or describe in detail) the DLRS record you created to do the rollup.

Also, are you saying that the field being updated in your screenshot is the field you are trying to aggregate child data to? If so, the tool does not support text-based rollups yet.

Thanks

joshh347 commented 10 years ago

The Rollup is set to count the number of Child Records (Retail Location) on an account with a an Account Status of "Authorized". It is aggregating a numerical field though. The rollup itself seems to be working, but we just can't edit/save or create/save new Accounts. 2014-07-02_1002

joshh347 commented 10 years ago

Also, I received an email with this error log.

Apex script unhandled trigger exception by user/organization: 005A0000004xOZt/00DA0000000gc1x

dlrs_AccountTrigger: execution of AfterInsert

caused by: dlrs.SObjectDomain.DomainException: Permission to access an dlrsLookupRollupSummaryc dennied.

(dlrs)

Trigger.dlrs_AccountTrigger: line 7, column 1

wes1278 commented 10 years ago

Josh,

In your field "Relationship Criteria", the text you put in that field should be exactly the syntax of what you want to put into a SOQL WHERE clause. Unfortunately, this tool still has a slight dependency on "code" and not "clicks". I'm working on improving this as soon as time permits.

You need to write the following in your Relationship Criteria field:

RecordTypeID = '012A00000019Ogz' AND Acount_Status__c = 'Authorized' 

For the second issue you have, it sounds like the profile for the user you are logged in with doesn't have permissions to read the dlrsLookupRollupSummaryc object. Go to Setup --> Manage Users --> Profiles; select the profile of your user record, and then make sure that there is at least read access to this object.

Let me know if you have any other issues.

Best of luck!

-Wes

afawcett commented 10 years ago

@joshh347 @wes1278 RE: Permission to access an dlrsLookupRollupSummaryc dennied, take a look at this blog (see the Installation Improvements section) where i talk about the Permission Sets included in the package. If these do not work for you, you can clone them or at least use them as a guide as to what to set manually on your profiles.

joshh347 commented 10 years ago

Thank you! I added Read Access to the following Custom Object Permissions on each of our Profiles and it solved the problem:

Lookup Rollup Summaries Lookup Rollup Summary Logs
Lookup Rollup Summary Schedule Items