Skip to content

Performing Rollups and Repeated Queries #187

@branderson-js

Description

@branderson-js

In the example for Avoid Repeated Queries it is shown being used in the Before Insert Context.

However, if I want to leverage a query like this:

Parent_Object__c[] sObjectList= [
                SELECT Id,Rollup_Field__c,
                (SELECT Field_To_Rollup__c FROM Child_Object__c)
                FROM Parent_Object__c
                WHERE Id IN :parentObjectIds
            ];

The sub-query results won't include the most recent inserts to the DB in the beforeInsert context.

So my question is, would I have to create two TAF Custom Metadata records, one for before in your example and one for after like I am trying to achieve with each sub-class implementing the corresponding TriggerAction interface?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions