Thanks for confirming all the details , we too faced similar issue in our org ( the LWC page was visible for the profile in UAT but not in prod)
The RCA for our issue is the FLS , one of the field getting used in the LWC didnt have FLS for the user profile , so thats why the whole LWC was not visible.
Once the read only permission is given to the issue field , the page started loading.
Can you kindly cross validate the FLS , if there is no error getting captured either in inspect--> Console or developer console.
We cannot control LWC access directly VIA profile, but we can control the access via page layout.
Relevant Link : https://salesforce.stackexchange.com/questions/223696/lightning-component-visibility-based-on-profile ,
Since you are stating that few profiles are not able to access , can you please check at the layout level , if there is any configuration present to control the LWC visibility based on profile.
Hope It helps, if so kindly mark it best answer to close this question.
For validating any configuration is present or not . Kindly follow the below steps.
Open the page in which LWC is configured.
Click on setup --> Edit page
Once the app builder window opens --> click on LWC component
On right side of the page you can see component visibility, you need to check whether there are any confirgurations present to hide the LWC based on the profile.
I have checked things, - the object and field is visible to the profile in question - the controller is accessible - Set component visitibilty is not present
I see that the profile has acees to the page in UAT but not in production. I saw that the fields didn't had visibility to the profile. I added the visibility in fields. - the controller is accessible - Set component visitibilty is not present
Thanks for confirming all the details , we too faced similar issue in our org ( the LWC page was visible for the profile in UAT but not in prod)
The RCA for our issue is the FLS , one of the field getting used in the LWC didnt have FLS for the user profile , so thats why the whole LWC was not visible.
Once the read only permission is given to the issue field , the page started loading.
Can you kindly cross validate the FLS , if there is no error getting captured either in inspect--> Console or developer console.
Thanks for confirming all the details , we too faced similar issue in our org ( the LWC page was visible for the profile in UAT but not in prod)
The RCA for our issue is the FLS , one of the field getting used in the LWC didnt have FLS for the user profile , so thats why the whole LWC was not visible.
Once the read only permission is given to the issue field , the page started loading.
Can you kindly cross validate the FLS , if there is no error getting captured either in inspect--> Console or developer console.
Then the last left option would be FLS.
Thanks,
Karthik
All Answers
Please check if you need to give access to related Apex class to the concerned profiles.
This can be done in two ways;
Go to profile -> Enabled Apex class access -> Edit -> Add the Classes and Save
Go to the class -> Click on Security -> Select Profiles and add to enabled profiles -> Save
If this information helps, please mark the answer as best. Thank you
We cannot control LWC access directly VIA profile, but we can control the access via page layout.
Relevant Link : https://salesforce.stackexchange.com/questions/223696/lightning-component-visibility-based-on-profile ,
Since you are stating that few profiles are not able to access , can you please check at the layout level , if there is any configuration present to control the LWC visibility based on profile.
Hope It helps, if so kindly mark it best answer to close this question.
Thanks,
Karthik
How can i verify " if there is any configuration present to control the LWC visibility based on profile.", please ?
For validating any configuration is present or not . Kindly follow the below steps.
- Open the page in which LWC is configured.
- Click on setup --> Edit page
- Once the app builder window opens --> click on LWC component
- On right side of the page you can see component visibility, you need to check whether there are any confirgurations present to hide the LWC based on the profile.
-

Thanks,Karthik
Then other way to debug is , login through the profile from which LWC was not showing ,
- Open the record.
- Right click on the page --> click on inspect
- check in console if any error is getting printed.
One more confirmation i would like to know is , there no code present in LWC HTML and JS part right where the layout wont be visible for few profiles.Thanks,
karthik
- the object and field is visible to the profile in question
- the controller is accessible
- Set component visitibilty is not present
@Jaya Karthik karnati
I see that the profile has acees to the page in UAT but not in production.
I saw that the fields didn't had visibility to the profile. I added the visibility in fields.
- the controller is accessible
- Set component visitibilty is not present
What are other things to verify
Thanks for confirming all the details , we too faced similar issue in our org ( the LWC page was visible for the profile in UAT but not in prod)
The RCA for our issue is the FLS , one of the field getting used in the LWC didnt have FLS for the user profile , so thats why the whole LWC was not visible.
Once the read only permission is given to the issue field , the page started loading.
Can you kindly cross validate the FLS , if there is no error getting captured either in inspect--> Console or developer console.
Then the last left option would be FLS.
Thanks,
Karthik