0

I am working on a DLRS and am not quite sure where I am going wrong. I keep getting an error on the Relationship Criteria fields. Here is the error message:

Error:

Relationship Criteria: Relationship Criteria 'MAX (cv__Amount__c)' 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 'unexpected token: ')''

Basically, I am trying to pull the primary (Maximum money going to it) accounting designation from a donation and have it appear on the donation record. For the where statement or Relationship Criteria - I am using:

MAX(cv_Amount__c)

And then the field in the relationship criteria fields is obviously cv_Amount__c. However its saying that is not valid. I've tried other variations but none work.

Any suggestions?

Thanks so much in advance

2

Your Relationship Criteria shouldn't include an aggregate operation. Define your aggregation with the Field to Aggregate and Aggregate Operation fields on your rollup summary definition.

If you're trying to find the maximum amount represented on a child object, you want the Aggregate Operation "Max" and the Field to Aggregate cv_Amount__c. This field must be on your child object.

If instead you want to select a different field on the child object that has the greatest cv_Amount__c, choose the Aggregate Operation "First" or "Last", populate cv_Amount__c in the Field to Order By field, and the name of the field whose value you want populated on the parent in the Field to Aggregate.

Your Relationship Criteria should define the criteria for selecting which child records you want to rollup. It must be substitutable into a SOQL WHERE clause.

  • I see! That makes sense, however I want to rollup the name of the accounting code that has the max amount of a donation designated to it, not just the amount itself. – AI_Ops Dec 19 '18 at 16:18
  • Then you want the second of the two options above. Aggregate option "First" or "Last", ordering by the amount. – David Reed Dec 19 '18 at 16:20
  • That is what I had originally tried and it did not work :( – AI_Ops Dec 19 '18 at 16:30
  • In what way did it not work? How did you configure it? Did you receive an error? – David Reed Dec 19 '18 at 16:34
  • 1
    That isn't related to DLRS. Your own org's OpportunityTrigger is broken. DLRS triggers have names starting with dlrs_. – David Reed Dec 19 '18 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.