Skip to main content

Use Lightning Component at different places using Salesforce Targets

 

Agenda

    


Using the blogs functionality we would be more clear about how we use Lightning Web Component over different places in Salesforce and how we can make it available.


What we are going to do.

So basically, I am writing this blog to give you an overview of where we can use Lightning Web Components in our Salesforce Org and outside the Salesforce Org and how we can display the name of the Component different from its original name.


Lightning Web Component

First of all, What is the lightning web component?

So, The Lightning Web Components is lightweight and delivers exceptional performance. Most of the code you write is standard JavaScript and HTML.


The Lightning Web Component is not just limited to Lighting Record or Home Page.

We can use it at many places in the Salesforce org or outside the org. And to exposed the Lightning Web Component we first need to set the isExposed functionality of the Component present in the meta.xml file to true:


<isExposed>true</isExposed>


And to make it visible at the desired place we have to set the targets same in the meta.xml file:


<targets>

      <target>lightning__FlowScreen</target>

  </targets>

 We can use a lightning web component at many places like:

  1. Lightning Record Page.

  2. Lightning Home Page

  3. Lightning App Page

  4. Flows

  5. Utility Bar

  6. Comunity Page

  7. Standalone Apps

  8. VisualForce Page

  9. Outlook

  10. Gmail

  11. Custom Tabs

  12. App Exchange etc.


By Setting the targets fields inside the meta.xml files.


Master Label:


Many times a situation comes when we can’t display the original name of the component and we need to show some other name of the component to expose it.

At that time, we use Master Label. 

Master Label sets the label of the component as per our requirement which is visible to the end-user and without exposing the API name of the component.


<masterLabel>Best Component Ever</masterLabel>


Description:


We can also set the description of the component using the meta.xml file :

<description>This is a demo component.</description>

Comments

Popular posts from this blog

Using Data - Attributes in Lightning Web Component (LWC)`

  Agenda      While working with Salesforce data we need to play with Id’s (Identifiers). An ID can be associated with a Record or with a specifier. While working with records when we need to make changes or view any particular record details, we need their ID’s, as I describe in my previous blog’s how can we show or edit any salesforce record with the help of Basic components of Salesforce.  To create forms that let users view, edit, and create Salesforce records, use Lightning-record-form, Lightning-record-edit-form, and Lightning-record-view form components. And To use these components we need Salesforce Record ID. Blog Details This Blog gives us a brief about how can we get a particular record Id or value after any event using Data - Attributes.  What we are going to do In this blog, we use Data - Attribute functionality from HTML5  in our Lightning Web Component and use data attribute to get...

Select - Deselect checkbox in Lightning Web Component

  Agenda In the previous blog, we are working with a single record and manipulating it as per the requirements, but when we are working for the organization we need to think to cover larger aspects. And while working with salesforce data we should be aware of the fact that we might need to work with data in bulk. So, when we need to work with more than one record we use checkbox functionality and use that checkbox to see which record we need to make changes to. Blog Details The blog gives us a brief that how we select and unselect all checkboxes from the header checkbox. What we are going to do In this blog, we use a table to show the records with the checkbox for each record and a header checkbox to select - unselect all records. Requirements: You need to have access to your org.     Should have installed the VS Code Installed in your system.    You should have some basic knowledge of Lightning Web Component. You must have some proper records ...

Displaying User Level’s Dynamically In Lightning Web Component

  Agenda I am writing this blog, to display dynamic user data beautifully, It enables each user to see the users they need to report. With this dynamic component, you can control data visibility without having to create a separate component as well, with its own running user.  Now, It’s time to show the user’s of our organization dynamically their role in a beautiful way. How does it work? You fetch the User’s record with a simple Apex SOQL query and just displaying details Dynamically over a Lightning Web Component, And place that component where ever you want. Requirements: You need to have access to your org. Should have the VS Code Installed in your system. You should have some basic knowledge of Lightning Web Component. About Lightning Web Component (LWC): Lightning Web Components are lightweight custom elements based on native HTML and Modern JavaScript. Lightning Web Compone...