Newer Version Available
Create Feature Parameters for Your Second-Generation Managed Package
To create a feature parameter for a 2GP managed package, create an individual XML file.
Here are details on the file naming convention, folder structure, and the attributes you use
when creating feature parameters.
A package can include up to 200 feature parameters.
- Folder Structure
- Feature parameters are stored as files in your Salesforce DX project folder.
- Under the root force-app folder, create a folder and name it featureParameters. Store your feature parameter files in the feature parameters folder. Each feature parameter you create must have its own separate file.
- File Naming Convention
- The naming format for feature parameter files is <name>.featureParameter<type>-meta.xml.
- The name is the API name of the feature parameter.
- The type is the feature parameter type. Feature parameters can be booleans, integers, or
dates.
Type File Name Format Boolean .featureParameterBoolean-meta.xml Date .featureParameterDate-meta.xml Integer .featureParameterInteger-meta.xml
- Feature Parameter Attributes
- Feature parameters include these three fields.
Field Name Description dataflowDirection Indicates which direction this parameter is transferring data. Each feature parameter value gets transferred in one of two directions:
- From your LMO to a subscriber org (LmoToSubscriber)
- From a subscriber org to your LMO (SubscriberToLmo)
masterLabel The label of the feature parameter. This label displays in the app. value The value of the feature parameter. Booleans, integers, and dates are all valid values. Integer values can’t exceed nine digits.
- Examples of Feature Parameter file
-
AdvancedPricingEnabled.featureParameterBoolean-meta.xml
NumberofLedgers.featureParameterInteger-meta.xml
ProjectActivationDate.featureParameterDate-meta.xml