You need to sign in to do that
Don't have an account?
Having trouble getting a trigger to fire to create a Campaign Member from Lead
I am trying to create a campaign member when my lead status and custom field lead sub status move to a certain PL value. I am not getting errors but the trigger is not firing. Can I get some help on understanding why this may not be working, please. Thanks in advance!
trigger CreateCampaignMember on Lead (before update) { List<CampaignMember> members = new List<CampaignMember>(); for (Lead CovL : Trigger.new) { if (CovL.Status == 'Unqualified' && CovL.Lead_Sub_Status__c == 'No Contact, Workflow Complete') { CampaignMember cm = new CampaignMember(CampaignId = '7010x0000000e3j', LeadId = LeadId.Name, Status = 'Sent'); System.debug(Lead.Id); members.add(cm); } try{ insert members; } catch(DmlException e) { System.debug('An unexpected error has occured: ' + e.getMessage()); } } }
The trigger is not fired because you don't see a new campaign member or because you don't see any message about the trigger in the log? (developer console, sandboxes).
The triggers must be activated (checkbox) by the way even it is rarely the problem.
Regards
All Answers
The trigger is not fired because you don't see a new campaign member or because you don't see any message about the trigger in the log? (developer console, sandboxes).
The triggers must be activated (checkbox) by the way even it is rarely the problem.
Regards