Issue Packaging Custom Report Types Involving Campaign Member with Custom Fields
Last updated 2018-02-10 ·Reference W-4037296 ·Reported By 10 users
Error installing a package when a Custom Report Type (CRT) with Campaign Member object is added as a component and there is a custom Campaign Member field in the CRT. It requires a corresponding Lead field to be added. Package installs successfully if a custom Lead field is added with the same API Name.
But after the installation, another issue occurs. The campaign member custom field is being removed in the Custom Report Type field layout. As a result, custom fields added in the displayed columns or filter are dropped in the Report included in the package that uses the CRT.
1 Go to a Demo Org
2 Create a custom field in the Campaign Member object .
Click path: Setup | Campaign Member | Fields
3 Create a custom report type. Click path Setup | Report Types.
-Select ‘Campaigns’ as the Primary object
-In the Object Relationships (Object B), select ‘Campaign Members’
-The custom field created in #1 will automatically be included in this CRT. To confirm, click ‘Preview Layout’ in the ‘Fields Available for Reports’ section of the report type.
4 Create a new report based on the CRT created in the prior step
Click Path: Reports tab | New Report
In ‘Select Report Type’ page, search for the CRT you created.
5 Create a Package, doesn’t matter if managed or unmanaged
Click path: Setup | Packages
Include the following components:
-Custom Report Type: (Created in # 2)
-Report: (Created in #3)
This will create version 1.0 of the package.
STEPS TO REPRODUCE
1 Install the Version 1.0 of the package created above in a subscriber org:
Sample Subscriber Org:
Actual Result: Install Failed
This app can't be installed.
There are problems that prevent this package from being installed.
(CRT_Campaign_with_Campaign_Members) In field: field - no CustomField named Lead.Update_Status__c found CRT_Campaign_with_Campaign_Members: In field: field - no CustomField named Lead.Update_Status__c found
(public/CRT_Report_Campaigns) invalid report type public/CRT_Report_Campaigns: invalid report type
Expected Behavior: Notice that the error is referencing a missing Lead field despite the object not being included in the report type. The campaign member object has a lookup to Lead/Contact but this has no involvement in the sample report
***To get around this error and replicate the other issue, proceed to Part 2:
1 Go to the same Demo org where you created the package version 1.0
2 Create a Lead custom field with the same name as the custom campaign member field created in SETUP PREREQUISITE.Part1
Click Path: Setup | Leads | Fields
2 Go to the Package created in SETUP PREREQUISITE.Part1 and add the Lead custom field in the package
3 Upload the package
This will create a new version of the package
STEPS TO REPRODUCE
1 Login to the Subscriber Org:
Install the latest Package version created in SETUP PREREQUISITE.Part2
2 Access the report included in the package:
Actual Result: The filter applied in the custom report was dropped
It is using the custom Campaign Member field which is part of the package but notice that in the CRT, the field has been removed in the layout.
Expected Result: The field should remain added in the CRT to maintain the campaign member fields in the report.
Is it Fixed?
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.