function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gurleen KaurGurleen Kaur 

Redirecting to a Lightning Component from Apex Class not working in Communities

I have a Lightning Component which implements 'isURLAddressable' interface. I am calling this component from my Apex Class.

ApexClass
...
'/lightning/cmp/c__TestComp?c__param1=test';
...

Within Salesforce, this URL works fine and I get navigated to my TestComp component. But in Communities,it is not working.
I tried modifying the URL to below:

...

'/<CommunityURL>/lightning/cmp/c__TestComp?c__param1=test'
---- Not Working in Communities

OR

'/<CommunityURL>/cmp/c__TestComp?c__param1=test' ---- Not Working in Communities ...


Any idea on how can I call Lightning Component from Apex class which could work in Communities?
VinayVinay (Salesforce Developers) 
Hi Gurleen,

As per below documentation 'isURLAddressable' is not supported for communities.

https://developer.salesforce.com/docs/component-library/bundle/lightning:isUrlAddressable/documentation

Check if you can use 'lightning:navigation'.

https://developer.salesforce.com/docs/component-library/bundle/lightning:navigation/documentation

Thanks,
Vinay Kumar