Salesforce: Lightning Experience Button Converter

Salesforce has introduced a new “Lightning Experience Configuration Converter” tool to help you in migrating your Salesforce instance from Classic to Lightning experience.

So what can this tool do for you? Currently, it only supports custom button conversion.

This is mainly used to convert javascript buttons to lightning ready components, such as custom action or lightning component.

 

This is how the converter looks like:

 

 

 

How To

To use the tool:

  1. Login to https://lightning-configuration.salesforce.com/ with your Salesforce login
  2. Click on “Settings” in the top right corner to define the objects that you would like to scan
  3. Click on “Refresh Buttons” under “Detected Buttons” tab
  4. Click on the action next to the javascript button found:
    • Preview – preview the code generated by the tool
    • Convert – this will create the lightning component
    • Convert and Deploy – this will create the lightning component and deploy the action to page layout

 

Test Result

Based on a sample javascript button, the tool will create a button + a new lightning component that inherits LCC_GenericLightningComponent.

Component:

 

<aura:component extends="c:LCC_GenericLightningComponent" >
 <aura:set attribute="partially" value="false"></aura:set>
 <!-- User Interface -->

 <div class="slds-scrollable slds-p-around_medium slds-text-heading_small" id="modal-content-id-1">
  <p style="height: 108px; word-wrap: break-word;"><a style="outline: 0;" href="https://github.com/developerforce/LEXComponentsBundle" target="_blank">Sample Lightning Component Action</a></p>
  <br/>
 </div>
 <div class="slds-modal__footer">
  <lightning:button class="slds-button_brand" onclick="{!c.accept}" label="Accept"/>
 </div>


 <!-- The height of the modal is defined in salesforce, when you create the new action. -->
 <!-- Recommended height size: 250px -->

</aura:component>

 

Controller:

 

({
    accept : function(component, event, helper) {
        $A.get("e.force:closeQuickAction").fire();
    }
})

 

 

The component doesn’t include the complete solution of the old javascript button, however, this is a good start to enhance the component from here.