Feature Parameter Metadata Types and Custom Objects
Feature parameters are represented as Metadata API types in your package metadata, as
records of custom objects in your LMO, and as hidden records in your subscriber’s org.
Feature Parameter Fields
Feature parameters are represented as Metadata API types and store boolean, integer, or date values.
The first time a subscriber installs your package, a FeatureParameter__c
record is created in your LMO for each feature parameter. The feature parameter records include
these fields:
- FullName__c
- DataType__c (Boolean, Integer, or Date)
- DataFlowDirection__c
- Package__c
- IntroducedInPackageVersion__c
- Namespace_Prefix__c
Lifecycle of a Feature Parameter
- Set Up the Feature Parameter
- Start by defining your feature parameter in an XML file. Create one XML file for each feature parameter.
- Depending on how you’re using the feature parameter, you’ll also write code that enables you to check access rights or collect usage information after the parameter is set up.
- Subscriber Installs Your Managed Package
- When a subscriber installs or upgrades your package in their org, a FeatureParameter__c record for each feature parameter is created in the LMO. If these records were created during a previous installation or upgrade, this step is skipped.
- During package installation, junction object records are created in both the subscriber org and your LMO. A junction object is a custom object with two master-detail relationships. In this case, the relationships are between FeatureParameter__c and License__c in the LMO. These records store the value of their associated feature parameter for the subscriber org.
- Utilize Your Feature Parameters
- Use the junction objects to override the feature parameters’ default values or to collect data. Depending on the value of each feature parameter’s DataFlowDirection__c field, data flows to the subscriber org (from the LMO) or to the LMO (from the subscriber org). That data is stored in the junction object records.