Sometimes we need to hide header and sidebar of a Visualforce page or Standard layout. So here are some ways to hide header and sidebar for Salesforce Visualforce page and Standard layout.
Generally in Visualforce Page we use sidebar="false" to hide sidebar. To hide header and chat widget we use header="false" and showChat="false" respectively.
Hide Header and Sidebar from Visualforce Page with specifying header="false" and sidebar="false".
Hide Header and Sidebar from Visualforce Page or Standard Layout by adding isdtp parameter in the URL. The main purpose of isdtp can be used to hide Salesforce header and sidebar on Standard Pages.
vw – The Visualforce page will be rendered without header and sidebar, supports aloha theme, allows chatter.
lt – leaves off SF formatting, page header, sidebar, tabs and section header.
nv – The page will be rendered without the tabs and sidebar, and will accommodate all the buttons in a list view.
mn – Retains Old Salesforce Styling, hides page header(tabs) and sidebar.
PageReference pgref = new PageReference('/apex/pagename?recordId&isdtp=vw);
Hide Sidebar from Standard layout.
Go to – Setup || Customize || User Interface – checked the check box “Enable Collapsible Section”. After that you can show or hide sidebar in Standard layout.
You can add or remove a CSS style on a component or element during runtime. You can use the $A.util.addClass(cmpTarget, 'class') method to append CSS classes and $A.util.removeClass(cmpTarget, 'class') method to remove CSS classes from a component or element.
And you can use component.find('myCmp').get('v.class') method to retrieve the class name on a component, where myCmp is the aura:id attribute value.
Here is an example to adding and removing Styles on a Component during runtime.
Custom settings enable you to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. All custom settings data is exposed in the application cache, which enables efficient access without the cost of repeated queries to the database.
You can control the visibility of custom setting by specifying it as public or protected. If custom setting is marked as protected, the subscriber organization will not be able to access the custom setting. If it is marked as public, then subscriber org can also access it.
There are 2 types of custom setting, List and Hierarchy. Once you create custom setting, then you cannot change the type (List to hierarchy or vice versa).
List custom setting provides a reusable set of static data that can be accessed across your organization to all user.
Hierarchy custom setting uses a built-in hierarchical logic that lets you “personalize” settings for specific profiles or users. In Hierarchy custom setting for logged in user, system first check user then profile and then org wide setting in order to return data from hierarchy custom setting.
Custom settings do not support relationship fields.
Custom Settings have the same permission to edit the records and to edit the configuration. Both can be done with the “Configure Application” permission.
You can access custom setting data using instance methods and can avoid SOQL queries to database.
While migrating custom setting to another org, It only deploys the metadata, you need to upload data into the custom setting post deployment.
Custom setting can be used by formula fields, validation rules, flows, Apex, and the SOAP API.
You cannot access List custom setting in Validation rule. Only Hierarchy custom setting can be used.
You can perform CUD (Create, Update, Delete) operation on custom setting in apex.
Custom settings are not visible in test class without “SeeAllData” annotation.
Custom Metadat Types :
Custom metadata are like custom setting but records in custom metadata type considered as metadata rather than data. These are typically used to define application configurations that need to be migrated from one environment to another, or packaged and installed.
Custom Metadata Types have WAY more options that Custom Settings, like picklist fields, long text areas (in Spring ’17), page layouts, and validation rules.
You can control the visibility of Custom Metadata Types by specifying it as public or protected. If it is marked as public type, then anyone can see it. If it is marked as protected type, in the installed managed package subscriber organization, only Apex code in that managed package can use it.
You can create lookups between Custom Metadata objects.
Metadata Relationship provides the ability to add relationships from your custom metadata to other things in your app, such as other custom metadata, custom or standard objects and fields, and static resources.
In Custom Metadata, you can edit the records with “Configure Application” permission, but you require “Author Apex” to edit the configuration.
With custom metadata types, you can issue unlimited Salesforce Object Query Language (SOQL) queries for each Apex transaction.
While migrating Custom Metadata Types to another org, the associated data you created against it is also deployed to the target organization.
You cannot perform CUD (Create, Update, Delete) operation on custom metadata type in apex.
You can control the visibility of custom metadata type while adding it in package.
Custom metadata type are visible in test class without “SeeAllData” annotation.
({
getParamValue: function(component, event, helper) {
//Get Id Parameter Value From Community URL
var idParamValue = helper.getURLParameterValue().id;
console.log('Id-' + idParamValue);
//Get Name Parameter Value From Community URL
var nameParamValue = helper.getURLParameterValue().name;
console.log('Name-' + nameParamValue);
}
})
Lightning JS Helper:
({
getURLParameterValue: function() {
var querystring = location.search.substr(1);
var paramValue = {};
querystring.split("&").forEach(function(part) {
var param = part.split("=");
paramValue[param[0]] = decodeURIComponent(param[1]);
});
console.log('paramValue-' + paramValue);
return paramValue;
}
})
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject