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
chaithaly gowdachaithaly gowda 

How to launch a flow from lightning using pagereference

Hi

I have a requirement to launch a flow from lightning component using pagreference.
I was able to do it with WebPage pagereference type but domain name cant be consistant across the sandboxes.
So, trying to find out if we can navigate from a lightning page to a flow using lightning:navigation  
ShirishaShirisha (Salesforce Developers) 
Hi Chaithaly,

Greetings!

You can call the flow without including the domain name.Please refer the sample code below:
 
gotoURL : function (component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": "/006/o"
    });
    urlEvent.fire();
}

Here,instead of "/006/o" you can use the flow url as below:

/flow/flowname

Reference:https://developer.salesforce.com/docs/component-library/bundle/force:navigateToURL/documentation

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
chaithaly gowdachaithaly gowda
Thanks Shirisha.
But I am trying to acheive this using pagererence and looking for some solution in this aspect.
Any other assistance will be much appreciated ,Thanks.