So, you’ve created a custom report type and have been using it for a while. One day you go to use it and realize it is missing all the new fields you’ve added to your org. You can go and edit the report type and drag in the new fields, but of all the interfaces in Salesforce, the Custom Report type one has to be one of the most maddening. (I reserve my anger at State and Country Picklists for the worst at being so damn slow.)
Rather than drag in individual fields, we can use the metadata API to solve the problem. Here are the steps I use:
- Create a new report type with the same relationships. Leave it in “In Development” status. This new report type will contain all the fields in your objects by default.
- Download the metadata for the report types. You can use MavensMate, workbench or other tools for this. If you use Workbench, here is a sample package.xml file you can use:
- Once you get the two metadata files, copy everything in the <sections> tag over from the new one to the old one and save.
- Use your preferred metadata tool to push the updated report type back to Salesforce.