Override Standard Buttons in Salesforce Lightning Experience

Using lightning:actionOverride in lightning component you can override standard buttons in Salesforce Lightning Experience.

Sample Code:

<aura:component implements="lightning:actionOverride" access="global">
    
    <!--Component Start-->
    <div class="slds-m-around--xx-large">
        Standard button override demo
    </div>
    <!--Component End-->
</aura:component>

Set Out of Office Message in Chatter

Enable Out of Office Message in Chatter:

  • From Setup enter “Chatter Settings” in the Quick Find box
  • Select “Chatter Settings”
  • Check “Users can set Out of Office messages”
  • Save

Set an Out of Office Message in Chatter:

  • Open your profile
  • In your profile page, click on “Out of Office”.

  • Enable Set Out of Office message.
  • Select the start date for the time you’ll be out of the office. The start date is just to let people know when you’ll be out. The message starts showing up next to your name as soon as you save it. It doesn’t wait for the start date.
  • Select the end date. Your message expires after the end date.
  • Leave the message as it is, or customize it.
  • Click Save.

Get Selected Record Type Id in Standard Button Overrides Lightning Component

Implementing lightning:hasPageReference interface, we can access the recordTypeId in lightning JS controller. lightning:hasPageReference provides access to the pageReference attribute.

The pageReference attribute can be populated only for the following page types:

  • standard__component
  • standard__navItemPage (for Lightning component tab only)
  • standard__recordPage
  • standard__objectPage

Example:

Lightning Component:

<aura:component implements="force:hasRecordId,lightning:actionOverride,lightning:hasPageReference">
    <!--Declare Attributes-->
    <aura:attribute name="selectedRecordId" type="Id" />
    
    <!--Declare Handler-->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
    
    <!--Component Start-->
    <div class="slds-m-around--xx-large">
        Selected Record Type Id : {!v.selectedRecordId}
    </div>
    <!--Component End-->
</aura:component>

Lightning JS Controller:

({
    doInit: function(component, event, helper) {
        
        //get record type Id
        var recordTypeId = component.get("v.pageReference").state.recordTypeId;
        component.set("v.selectedRecordId", recordTypeId);
        
        //get action name edit/new
        var actionName = component.get("v.pageReference").attributes.actionName;
        console.log('actionName-' + actionName);
        
        //get object API name
        var objectApiName = component.get("v.pageReference").attributes.objectApiName;
        console.log('objectApiName-' + objectApiName);
    },
})

Output:

Get Available Lightning Components In Your Org

  1. To get all available lightning components in your org, My Domain should be enabled in your Org.
  2. Log in to your org.
  3. Add componentReference/suite.app in your org domain URL.
  4. It should look like this :  https://yourorgdomain.lightning.force.com/lightning.force.com/componentReference/suite.app
  5. It will open Salesforce Lightning Component Library.
  6. Here you can see all the available components of your Org along with Salesforce Lightning Component examples.