Redirecting To Community Portal On Button Click From Record Level From Salesforce Lightning
In Salesforce Classic we all know how to redirect community portal from record level(button click or link) without log-out from the session using simple URL and while coming to lightning we can't use the same URL code for redirecting to community portal.
So what needs to be done in order to redirect from the record level in lightning????
Using below component and class we can redirect to Community Portal from record level on the button without session logout.
Steps to be followed
1. Create a custom Label which is having your Community Name like below
2. Create an apex class where you need to get session id and community portal id as below
3. Create a lightning Component say LaunchCommunity.cmp
4. Use below code the in the Renderer Component as i want to redirect to community portal on button click
5. Create a Quick Action in the Lightning and use the above-created lightning Component ( LaunchCommunity.cmp)
6. Assign you quick action to the layout
Hope the above functionality is helpful. Please comment below for any queries or suggestions.