Skip to main content

Feature Management Class

To check Custom Permission and Other Features

Check and modify the values of feature parameters, and to show or hide custom objects and custom permissions in your subscribers’ orgs.

Syntax:

FeatureManagement.checkPermission('CustomPermission_apiName');

Return Type:Boolean

Example : 
public static Boolean havingCperm = FeatureManagement.checkPermission(apiName);
OR
if(FeatureManagement.checkPermission(apiName)){your logic}


ClickHere for More Details.


For information about feature parameters, see “Get Started with the Feature Management App” in the ISVforce Guide.

In TestClass  to assign PermissionSet Use: 
PermissionSet ps = [SELECT Id,Name FROM PermissionSet WHERE Name = 'apiName'];
PermissionSetAssignment psa = new PermissionSetAssignment();
psa.AssigneeId = UserInfo.getUserId();
psa.PermissionSetId = ps.Id;
insert psa;

Comments

Popular posts from this blog

Maintain Your Administrator Certification for Spring ’25

  Manage Included Permission Sets in Permission Set Groups via Summaries Update user access more efficiently by specifying which permission set groups include a permission set directly from the permission set’s summary. Previously, to manage included permission sets, you were required to navigate to each permission set group’s page. From Setup, in the Quick Find box, enter  Permission Sets , and select Permission Sets. Select a permission set, and then click  View Summary . In the Related Permission Set Groups tab, click  Add  or  Remove . This change applies to Lightning Experience and Salesforce Classic (not available in all orgs) in Contact Manager, Group, Essentials, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com editions. Sort List Views by Multiple Columns To see your data in a more intuitive way and make your list views more actionable, you can now sort list views on object home pages by up to five columns. Select the c...

Maintain Your Platform Developer I Certification for Winter ’25

  Make Invocable Actions Easier to Configure with New InvocableVariable Modifiers Simplify the configuration of invocable actions using new modifiers from Salesforce. Both the defaultValue and placeholderText modifiers will appear in Flow Builder for the Action elements that correspond to an invocable method. Here’s how to use them. defaultValue Modifier : Set a default value for an input parameter. When the action is used, the input parameter will have a predefined value unless changed by the user. placeholderText Modifier : Set custom placeholder text for an input parameter. Text can provide examples or additional guidance to help users understand what to enter in the input field. Accessing these modifiers in Flow Builder makes it easier to configure and use the actions within your flows. This change applies to Lightning Experience and Salesforce Classic in Performance, Unlimited, Developer, Enterprise, and Database.com editions.

Platform App Builder Certification Maintenance (Winter '26)

 Maintain Your Platform App Builder Certification for Winter ‘26 Trigger a Flow When a File Is Attached Managing files just got a lot smarter. You can now automatically launch a flow whenever a file is attached to a record—no Apex code or complex workarounds required. This enhancement lets you set filters so that your flow triggers only when it matters. You can filter by: File type or extension  (for example, trigger only when a PDF is attached) File name  (for example, when the file name contains “Contract”) Created by  (for example, only for files uploaded by a specific user group) When your conditions are met, the File Attach event automatically kicks off the flow. This opens up powerful new automation use cases, like: Starting a contract approval process when a signed document is uploaded. Sending notifications when a compliance file is attached. Automatically tagging or categorizing records based on file type. To set it up, start by creating an Automation Event–...

Translate