I have a lot of custom report types (100+), adding a new/existing field to the report types is a tedious and manual process. I am looking for a Salesforce REST API or APEX snippet for doing the same.

  • 2
    For new fields there is setting you can enable to allow them to automatically get added to report type. In report and dashboard setting "Select Auto add new custom fields to custom report type layouts". For existing fields if same set of fields are to be added in multiple report types, I am thinking why not try metadata api
    – Elijah
    Commented Jun 24, 2021 at 11:27
  • @elijah thanks, I am looking for metadata API, I am not finding any references. Commented Jun 24, 2021 at 16:13
  • 1
    I meant more in terms of reducing effort as if you retrieve one of custom report types, you can add your xml (with same tags) then deploy it. If same fields are to be added in multiple report types , you would just create it once and re-use it (thinking out loud)
    – Elijah
    Commented Jun 25, 2021 at 0:34

1 Answer 1


Not sure if you were referring to https://github.com/financialforcedev/apex-mdapi.

The above can help you query for custom report types.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .