Play Games

Search This Blog

Showing posts with label Will the change in the roll up summary field cause trigger to fire in Salesforce. Show all posts
Showing posts with label Will the change in the roll up summary field cause trigger to fire in Salesforce. Show all posts

Monday, April 4, 2022

Will the change in the roll up summary field cause trigger to fire in Salesforce - Salesforce Globe For You

Will the change in the roll up summary field cause trigger to fire in Salesforce - Salesforce Globe For You

Answer: Yes. When the roll up summary field value changes,if there is any trigger on that object,the trigger will fire.

Example:

Step 1: created a custom rollup summary field on Account Sum_Of_Opportunities__c which will give sum of all opportunities.


Step 2: create trigger on Account

trigger AccountObjectTrigger on Account (after update) {

    for(Account acc:trigger.new) {

        system.debug('Trigger fired due to roll up summary field change');

    }

}

Step 3: When the opportunity updated,the account trigger fired and gave the output

Trigger fired due to roll up summary field change