0

I have created a screen flow. It has a text template. I have created a button in the template that will call a LWC. Below is the code added in text template: <a class="slds-button slds-button_brand button-sizing-border" style="length:0.025px" href="/lightning/cmp/c__myLWC&c__layout=lightning&c__tabIcon=custom:custom18&c__tabLabel=My LWC &c__ContextId={!recordId}" target="_self">Navigate to LWC</a>

However, if I click on the displayed button, the LWC doesn't get open and I get an error stating, This page isn't available in Salesforce Lightning Experience or mobile app.

Any solution or approach will be helpful. I have attached the error screen I see.

enter image description here

1 Answer 1

0

The target component must have a configuration file that looks as follows:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>61.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__UrlAddressable</target>
    </targets>
</LightningComponentBundle>

See Navigate to a URL-Addressable Component.

1
  • Thanks. I tried this method of adding the attribute in XML file, however I see an error in JS file when I add. lightning__UrlAddressable is not a valid TARGETS Commented Jun 6 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .