Skip to main content
K S (Company) a posé une question dans Commons Project: DLRS

I have a need that can't be done with a standard rollup summary field, so I'm trying this with DLRS.

 

We have a managed package that includes a single object for two sets of records: parent and child. 

 

The differentiator is record type; there are only two, Farm (parent) and Turbine (child). 

However, the child has a lookup (Parent_Location__c) to the Parent, so this is the relationship field. Naturally, it is blank on Parent records. 

 

I have set up the Relationship Field to: Parent_Location__c

 

Now is my question - Relationship Criteria:

 

Is the Relationship Criteria:

 

Parent_Location__r.RecordType.DeveloperName='Turbine'

 

Relationship Criteria Fields are:

RecordType

Parent_Location__c

 

Field to Aggregate = Id because it should count all child records.

 

Aggregate Operation = Count

 

I may not even need to reference the Record Type considering all records that should be counted will have a Parent record in the Parent_Location__c field. 

 

I have not activated this yet. I am in a sandbox, but would rather get it right the first time. 

 

Would love some advice. 

 

Thanks,

 

#DLRS SOQL

15 réponses
  1. 25 janv. 2023, 18:05

    I settled on the following, and it worked! All Turbine records have a value in the FX5__Parent_Location__c field, but the Parent does not have a value, of course. So I figured it was worth a try. 

     

    Granted, I still list the RecordTypeId in the Relationship Criteria Fields section, but not sure if it's even needed since it's not included in the Relationship Criteria. 

     

    I settled on the following, and it worked! All Turbine records have a value in the FX5__Parent_Location__c field, but the Parent does not have a value, of course. So I figured it was worth a try.

0/9000