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
kris chitkris chit 

Re-direct URL's in Salesforce1 and Lightning

Hi,

We have been using "PageReference" method in controller to re-direct url's in Classic, Salesforce 1 and Lighnting. But Salesforce no longer supports "PageReference" for Salesforce 1 and Lighting. So which method or how do I re-direct URL's in Salesforce 1 and Lightningt ?

Please guide me.

Thanks

 
Raj VakatiRaj Vakati
Hi Kris , 
You have to use force:navigateToURL in the case of lighting.
navigate : function(component, event, helper) {

    //Find the text value of the component with aura:id set to "address"
    var address = component.find("address").get("v.value");

    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": 'https://www.google.com/maps/place/' + address
    });
    urlEvent.fire();
}