+ Start a Discussion
Nashle PakNashle Pak 

Lightning Out : No access to data

Hello Ohana,
I use Lightning Out to integrate my LWCs on external sites.

My LWC displays contact records and works perfectly on my Salesforce app homepage.
User-added image

On an external site, my LWC is displayed but not the records.
User-added image
The code of the LWC and my application is available at this address:https://github.com/Nashle/lightningout/
The live is available at this address:https://nashle.github.io/lightningout/

Do I need to create an application connected with OAuth to allow GestUsers to access the application's data? And if so, how should it be configured to allow my LWC to display the data when it is hosted on a remote site?

Can you help me please ?
Best Answer chosen by Nashle Pak
Nayana KNayana K
UI API responses respect CRUD access, field-level security settings, and sharing settings(like "with sharing" mode). 
 Make sure you have proper OWD/ records shared with community guest user along with CRUD and field-level security. 

All Answers

Nayana KNayana K
UI API responses respect CRUD access, field-level security settings, and sharing settings(like "with sharing" mode). 
 Make sure you have proper OWD/ records shared with community guest user along with CRUD and field-level security. 
This was selected as the best answer
Nashle PakNashle Pak
Hello Nayana,

You're right, the user profile permissions and OWDs solved my problem!

I kiss you.
Nayana KNayana K
Hurray <3 
I’m glad it worked out!
Nashle PakNashle Pak
Aloha!

Today, I published a second LWC of sfdccoder.
https://sfdccoder.wordpress.com/2019/02/22/load-contacts-with-lightning-web-components-2/

The system works perfectly on my home page but not with lightning out (via the community).


The code of the LWC and my application is available at this address: https://github.com/Nashle/lightningout/
The live is available at this address: https://nashle.github.io/lightningout/

I look at the level of rights, a lot of things have made me dangerous. I did not touch it apart from the following.

I do not understand!

The LWC on my home page:
User-added image

LWC on my external site:
https://nashle.github.io/lightningout/

Access rights on the object:
User-added image

Access rights to the class:
User-added image

Other parameters:
User-added image

If I have to explain my problem differently:

I want to display a LWC on an external page. This component should display the list of contacts in an account. My page must pass (by magic?) An id that must be used to interact via a controler and @wire when loading the page.

Sorry, I started in LWC and Co, I only have this feature to finish.