Book Image

Salesforce Lightning Cookbook

By : Syed Chand Shah
Book Image

Salesforce Lightning Cookbook

By: Syed Chand Shah

Overview of this book

<p><span id="description" class="sugar_field">The new Lightning Experience combines three major components—Lightning Design System, Lightning App Builder, and Lightning Components—to enable anyone to quickly and easily create beautiful, modern enterprise apps. If you wish to meet the challenges that Lightning throws at you head-on, then look no further because this practical book will be your faithful companion and ensure that you make best use of the Lightning platform.</span></p> <p><span class="sugar_field"><span id="description" class="sugar_field"> The book starts by walking you through the three major Lightning Components and helps you enable and configure a Lightning solution. You will explore the art of working with standard components and build a basic layout for the application. Then, you will add more advanced components using the Lightning Framework. Finally, you will also build and migrate reports and dashboards to make your app look more professional. Towards the end of the book, you’ll make use of Design System to work with Salesforce data and lay out the entire page with the components that you’ve built, before integrating Visualforce in your application.</span> </span></p>
Table of Contents (11 chapters)

Preparing components for AppExchange


In this recipe, we are going to take a look at building the components by taking our goal into consideration, meaning that we need to publish our custom components on AppExchange.

Getting ready

We need to set the access levels to global for all the custom components that we have developed. We need to declare all the components, such as attributes, events, and more, as global.

How to do it…

  1. Currently, the component is in a random access level. Now we are putting it as access="global", and then as <aura:attribute…>. As of now, its access is set to public, and now we are putting it as global, as shown in the following code snippet:
<aura:component access="global"
 implements="flexipage:availableForAllPageTypes">
    <!-- for the label of the Name -->
    <aura:attribute access="global" name="enterName" type="String" 
     default="Enter Name"/>
    <ui:outputText value="{!v.enterName}" />
    <ui:inputText  />
    <ui:button...