+ Start a Discussion

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");
      "url": "/006/o"

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.
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.


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