The following are methods for FeatureManagement.
public static void changeProtection(String apiName, String typeApiName, String protection)
To show a custom object or custom permission, 'Unprotected'.
To hide a custom permission, 'Protected'.
Type: void
For custom permissions, you can toggle the protected value indefinitely. However, after you’ve released unprotected objects to subscribers, you can’t set visibility to Protected. Be sure to protect any custom objects that you want to hide before you release the first package version that contains them.
FeatureManagement.changeProtection('YourCustomPermissionName', 'CustomPermission', 'Protected');
FeatureManagement.changeProtection('YourCustomPermissionName', 'CustomPermission', 'Unprotected');
FeatureManagement.changeProtection('YourCustomObjectName__c', 'CustomObject', 'Unprotected');
public static Boolean checkPackageBooleanValue(String apiName)
Type: Boolean
The value that’s currently assigned to the value__c field on the FeatureParameterBoolean__c record that associates the feature parameter with its related license.
public static Date checkPackageDateValue(String apiName)
Type: Date
The value that’s currently assigned to the value__c field on the FeatureParameterDate__c record that associates the feature parameter with its related license.
public static Integer checkPackageIntegerValue(String apiName)
Type: Integer
The value that’s currently assigned to the value__c field on the FeatureParameterInteger__c record that associates the feature parameter with its related license.
public static Boolean checkPermission(String apiName)
public static void setPackageBooleanValue(String apiName, Boolean value)
Type: void
public static void setPackageDateValue(String apiName, Date value)
Type: void
public static void setPackageIntegerValue(String apiName, Integer value)
Type: void