0

So I have this apex trigger I wrote which is working just fine. I am currently experiencing a very weird issue where the Trigger does not work if the Campaign where the campaign members are from has a parent campaign.

My child campaign has the exact same conditions as the parent campaign, including the available options for member statuses but the trigger is not firing at all when I apply updates to its campaign members.

So to be as clear as possible, let's say I have two campaigns. one is the parent of the other:

-ParentCampaign -ChildCampaign

So even tho both campaigns have the exact same conditions the trigger does not fire at all for campaign members from the ChildCampaign.

Here is my trigger:

trigger MyTrigger on CampaignMember (after insert, before update, after update) {
    ParentChildHandler handler = new ParentChildHandler();
    if (Trigger.isUpdate){
        if(Trigger.isAfter){
           handler.inheritMemberStatus(trigger.new);
        }
    }
}
  • The trigger will be fired irrespective of whether its fired from child or parent as long as it is an after insert and before/after update. A good way to verify is to put a system.debug in your trigger. You may like to review any specific condition within your handler to see if you have certain conditions, which is not allowing the flow to be executed in case of child campaigns. – Jayant Das Apr 25 '18 at 21:48
  • 1
    see exceptions for mass campaign status changes: developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… – cropredy Apr 25 '18 at 21:58
1

Trigger will not fire for when there is a mass campaign status changes. Please refer the below link https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_ignoring_operations.htm?search_text=triggers

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.