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
Palani_ChinnasamyPalani_Chinnasamy 

Something has gone wrong. Cannot read property 'setParams' of undefined. Please try again.

Hi All,

I am getting the error When i try to fire a event wit following code 
gotoURL : function (component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": "/006/o"
    });
    urlEvent.fire();
}

 
Vincent WahVincent Wah
I got the same error.
$A.get("e.force:navigateToURL"); return undefined
Is there anyone has workaround?
Jai ChaturvediJai Chaturvedi
I think use of force:navigateToURL is allowed only in salesforce1 app.
NishantBansalNishantBansal
This event is handled by the one.app container. It’s supported in Lightning Experience and Salesforce1 only.

Please check the below link for your reference.

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToURL.htm

 
Jai ChaturvediJai Chaturvedi
I think you have to1. create application level lightning event.2. Assign handler for this event in lightning component to call some javascript function from lightning controller.3. While defining component in vf page fire this event with values/params. Check out this, might be helpful:http://cloudyworlds.blogspot.co.nz/2016/02/lightning-events-via-visualforce.html?m=1