1

Our org is using real-time DLRS fields on a few custom objects related to a custom sales order management implementation. The fields are basically there to summarize order total when order items change, summarize total purchased on account records, etc.

We've recently encountered SOQL limits error when running certain autolaunched flows, even though they are as optimized as possible - no SOQL queries in loops, everything is done in memory when possible, etc.

Upon closer inspection, I've noticed that the bulk of the SOQL queries are actually being made by DLRS package. First I assumed it is querying child records to produce summaries, but oddly, the queries are related to the object used to store DLRS field configurations.

While the debug log is truncating these statements, it is clear that they are accessing DLRS configuration records:

SELECT Name, dlrs__Active__c, dlrs__AggregateAllRows__c, dlrs__AggregateOperation__c, dlrs__AggregateResultField__c, dlrs__CalculationMode__c, dlrs__CalculationSharingMode__c, dlrs__ChildObject__c, dlrs__ConcatenateDelimiter__c, dlrs__FieldToAggregate__c, dlrs__FieldToOrderBy__c, dlrs__ParentObject__c, dlrs__RelationshipCriteriaFields__c, dlrs__RelationshipCriteria__c, dlrs__RelationshipField__c, dlrs__RowLimit__c, dlrs__TestCodeSeeAllData__c, dlrs__TestCode__c, dlrs__UniqueName__c FROM...

and

SELECT DeveloperName, Id, Label, dlrs__Active__c, dlrs__AggregateAllRows__c, dlrs__AggregateOperation__c, dlrs__AggregateResultField__c, dlrs__CalculationMode__c, dlrs__CalculationSharingMode__c, dlrs__ChildObject__c, dlrs__ConcatenateDelimiter__c, dlrs__Description__c, dlrs__FieldToAggregate__c, dlrs__FieldToOrderBy__c, dlrs__ParentObject__c, dlrs__RelationshipCriteriaFields__c, dlrs__RelationshipCriteria__c, dlrs__RelationshipField__c, dlrs__RowLimit__c, dlrs__TestCodeSeeAllData__c, d..

I'm attaching a screenshot from the Execution Overview log where 58 out 67 total queries are made to retrieve DLRS configuration.

Is there a way to optimize this?

Thanks.

Execution Overview showing a large number of DLRS SOQL queries

Your Answer

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

Browse other questions tagged or ask your own question.