Redirect to a record or any other page not working for an aura component which is embedded in a VF page.
tried force:navigateToURL, but does not work as I get an error that says "object not defined" for e.force:navigateToURL.
tried the static URL redirect, this works, but the page opens in the iFrame where the VF page sits on the detail page of the record.
I was hoping to find a way to redirect to a record or any other page from the detail page on which the VF page is embedded to a new page on the browser.
Any ideas/suggestions?
I need it to work for the VF page embedded which is calling an aura component.
Best Answer
One way that will work is to add a "callback" attribute to the component definition. In that callback you can trigger a redirect.
Add this to your component:
In your helper class you would call it like this:
Finally in your instantiation, define the callback:
Oh and don't worry that the
attribute
definition is a string - the magic of Javascript takes care of that for you ;)