16.1 how to make our First SF LWC available in app builder ?

 how to make our SF LWC available in app builder ?

ChaTo make your Salesforce Lightning Web Component (LWC) available in the App Builder, you need to expose it properly by configuring the component's metadata fil

1. Update the Component’s Metadata File

Every LWC has a metadata configuration file with the suffix .js-meta.xml. Open this file and ensure it contains the required configurations.

Here’s an example of a basic configuration for App Builder:

xml
<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="YourComponentName"> <apiVersion>58.0</apiVersion> <!-- Use the API version of your Salesforce org --> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> </targets> </LightningComponentBundle>
  • <isExposed>: This must be set to true to make the component available in the App Builder.
  • <targets>: Defines where the component can be used:
    • lightning__AppPage: For App Pages
    • lightning__RecordPage: For Record Pages
    • lightning__HomePage: For Home Pages

If you want your component to be available in all types of pages, include all three targets as shown above.

Comments

Popular posts from this blog

API Names in Salesforce

18 - LWC - BEST PRACTICES - For accessing HTML elements and their values in JavaScript

6 - Object Relationships (Lookup and Master-Detail and Junction Objects)