I am moving existing metadata from an org into unlocked packages.I have ran into a problem when it comes to record types.

Problem 1

Because each record type needs to know which pick-list values it has access too, I need to move all pick-lists and default pick-list values as well, but it appears like there is no way to actually package default pick-list values.

Problem 2

If another unlocked package adds a new pick-list to the object. How will the record type know about the new pick-list?

So my question is

How do you package record types correctly?


The only solution I have seen so far is putting all the schema in a base package. All other packages will have a dependency to this base package.

One example can be found in the Easy Spaces project from the sample gallery - have a look at the sfdx-project.json: sfdx-project.json

You can see that the ESObjects package is the base package and all others define a dependency on this package. Every package lives in a separate source folder.

One downside with this approach is that the base package will grow fast as each and every object and field from all the "real" packages will go into the base (and of course all the dependent metadata which is defined in the xml files - for example cross-object-formula fields).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.