You need to sign in to do that
Don't have an account?
![Marketing Marketing 27 Marketing Marketing 27](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
CampaignMember.Campaign.Name coming up NULL in CampaignMember AfterInsert Trigger
I am making an After Insert Trigger on Campaign Member. A certain method on the Trigger Handler class should fire if the Campaign Name of the Campaign Member is on a list of about 4 different Campaign Names.
When I execute the below method, it is telling me that Cmp.Campaign.Name is NULL. But when I query all Campaign Members in Query Editor, Campaign.Name comes through fine. Why is it doing this and how can I get the name?
When I execute the below method, it is telling me that Cmp.Campaign.Name is NULL. But when I query all Campaign Members in Query Editor, Campaign.Name comes through fine. Why is it doing this and how can I get the name?
public static void afterInsert(List<CampaignMember> cmpMembers){ for(CampaignMember cmp : cmpMembers){ if(eventList.contains(cmp.Campaign.Name)){
![Marketing Marketing 27 Marketing Marketing 27](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Additionally, I am noticing things like cmp.Lead.Custom_Field__c and cmp.Contact.Custom_Field__c are also returning null. They work fine in queries and don't return apex errors, but they just come back null when code is executed.