CampaignMember Object will error when attempt to deploy code from the SF Sandbox to the SF Production using an APEX trigger for the MC Connect
Trailblazer Community

CampaignMember Object will error when attempt to deploy code from the SF Sandbox to the SF Production using an APEX trigger for the MC Connect

Marketing Cloud Integrations

Last updated 2018-11-09 ·Reference W-4520061 ·Reported By 0 users

No Fix

Summary
A client calling the email field on the CampaignMember Object will receive the following error when attempting to deploy code from the SF Sandbox to the SF Production enviorment.

Apex trigger <TriggerName> caused an unexpected exception, contact your administrator: <TriggerName>: execution of AfterInsert caused by: System.QueryException: No such column 'Email' on entity 'CampaignMember'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.: Class.et4ae5.triggerUtility.performTriggeredSend: line 264, column 1

The Connector uses API version 29

The Email field on the Campaign Member object is not visible with API Version 29.

Repro
Use the email field on the CampaignMember Object it will throw an error because the system cannot find the email field.

Workaround
The workaround for this is to create a custom formula field on the Campaign Member object and reference the Email field.

Then Reference the custom formual field in the Triggered Send Critieria and your test methods.

This should eliminate the error in deployment and make it accessible in the field criteria when creating a triggered send definition in the Sales Cloud.

Reported By (0)

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.