How to add LWC in Salesforce1 App for the community users.

Variance InfoTech Pvt Ltd
2 min readNov 28, 2019

Step 1: Create a new community

  1. Go to Setup and Enter “All Communities”
  2. Select All Communities
  3. Click on New Community

# After Creating Community make the following changes in the Administrator settings

1. Member settings

=> Provide access to a profile

2. Login setting

=> Allow internal user to login

3. Preference setting

=> Show all settings in Workspaces

Step 2: Create a lightning application

(a) Go to Developer Console

(b) Select File | New | Lightning Application

Add LWC component into the application

# Load the LWC component into the app.

— — — — — — — — CODE — — — — — — — —

<aura:application access=”GLOBAL” extends=”ltng:outApp”>

<aura:dependency resource=”lwcComponant Name”/>

</aura:application>

— — — — — — — — — — — — — — — — — —

Step 3: Create a new Visualforce page

(a) Go to Developer Console.

(b) Select File | New | Visualforce page

Add Lightning Application that we created on the previous step, into Visualforce page

# Load the lightning application into the page.

— — — — — — — — CODE — — — — — — — —

<apex:page >

<apex:includeLightning />

<div id=”lightning” />

<script>

$Lightning.use(“c:LightningApplication”, function() {

$Lightning.createComponent(“c:lwcComponant Name”, {

objectName: “Account”

},

“lightning”,

function(cmp) {

console.log(“LWC component was created”);

// do some stuff

}

);

});

</script>

</apex:page>

— — — — — — — — — — — — — — — — — -

Step 4: Create a Visualforce Tab

  1. Go to Setup and Enter “Tab”
  2. Search for Visualforce Tab and Click on New

# Add Visualforce Page into the tab.

Step 5: Provide the Visualforce access in Profile.

  1. Go to Setup and Select Profile
  2. Select customer Community User Profile

© Click on Enabled Visualforce Page Access

Step 6: Add the Visualforce tab into the community.

  1. Go to Setup and Select Communities which you had created
  2. Select Builder and Click on the top left corner
  3. Select Administration
  4. Select Tab

Conclusion

Salesforce mobile app doesn’t support LWC directly that’s why we need to first create a Visualforce tab and page and include that lWC component into it.

For more detail click here, http://bit.ly/2OQOqqy

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Variance InfoTech Pvt Ltd
Variance InfoTech Pvt Ltd

Written by Variance InfoTech Pvt Ltd

Leading vTiger Open Source, Salesforce & SuiteCRM CRM solution consultants in India. Delivered 20+ iOS & Android Mobile app solutions.

No responses yet

Write a response