I am new to SF CRM and while I saw that there is a good answer for the same question for Scratch Orgs might also we need to fix the same issue for our package for PROD org so that we are able to release a bug-free version of our package. For the Scratch org, the solutions are provided here: Managed Package Installation Failure (Missing Task.RecordType) Please advise how we could resolve this by adding additional configuration for the Developer and the PROD kind of Orgs?

1 Answer 1


If your package depends on the existence of a task record type, you may include some record types directly in your managed package itself. This way, your package will be able to install in any org that supports record types.

Alternatively, you may choose to use dynamic apex, where you always query the field dynamically with Database.query and always access the field dynamically via someRecord.getSObject('RecordType')?.get('Name'). If you have other hard links, perhaps in validation rules or other automations, you would definitely need to include a record type in your Managed Package.

  • I would like to fix that issue with using metadata, as these errors only appear without actually using the RecordType in the Controller/Helper apex classes. Mar 2, 2023 at 15:24
  • What we actually did at the end was to remove the dependency of RecordTypes as it was not needed, but what helped with allowing the installation to complete was manually add at least 1 RecordType for the objects the package requested... I wanted to know how to include some of these RecordType with package.xml meta data entries. Sep 13, 2023 at 20:00
  • 1
    @ИскренСтаниславов Record types are packaged with object metadata, so as long as you have a CustomObject metadata entry for the Task object in the package.xml, it would include the record types for that object.
    – sfdcfox
    Sep 13, 2023 at 22:46

You must log in to answer this question.

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