I have a managed package that currently has a number of custom fields on Opportunity and OpportunityLineItem.
Some customers are now asking for similar functionality for Order and OrderItem.
If I add custom fields to Order and OrderItem and then bundle them in the managed package will I be creating a dependency on the Order feature being enabled? Not all orgs using the managed package will have the Order feature enabled.
I can use dynamic SOQL and schema metadata to remove explicit references to these custom fields from the Apex code, but I suspect the presence of the fields alone will be enough that the managed package would only install in Orgs where Orders are turned on.
How do people handle custom fields for optional Salesforce features?
Should I create a separate package that can optionally be installed to add the required custom fields for Order support? This secondary managed package would extend the first managed package. Maybe with defined interfaces in the base package that can be implemented in the secondary package and then invoked via reflection.
Update: I think I'm skirting around the concept of an extension package. I did find Supporting Multiple Editions using an Extension Package and Publishing Extensions to Managed Packages