We are trying to convert to the Salesforce lightning experience. One of the recent roadblocks is as simple as opening a new window or tab. The previously defined Java script button is now a lightning component used in a quick action. The need is to click a button, execute some validation and render a Visual force page as a PDF. When we use the Salesforce recommended "force:navigateToURL" the PDF is opened in the same window as the button originated. We would like to use a familiar 'window.open' but that is not recommended. If anyone has an idea how to open a new window\tab when a quick action button is clicked that would be great.

This is the component code we are currently trying to use:

var urlEvent = $A.get("e.force:navigateToURL");
"url": '/apex/RenderAsPDFVisualforce?Id=' + recordId,
"target": "_blank"
  • How did you achieve this ?
    – SFDC
    Apr 11, 2019 at 12:32

2 Answers 2


That should work. You just need to call urlEvent.fire(); as well.

  • 1
    Lightning Experience, non-console app, opened in same tab/window, but worked for my use case. Thanks to OP and @Ryan Villamin! Jul 15, 2019 at 17:52

If you are in a console app ( recommended ) , you can use lightning workspaceApi


Add the following line in your quickAction component

<lightning:workspaceAPI aura:id="workspace" />

Then you can request to open a new tab with your url

    var workspaceAPI = component.find("workspace");
        url: '/apex/RenderAsPDFVisualforce?Id=' + recordId,
        focus: true
    }).then(function(response) {
          // actions to do after opening tab if necessary
    }).catch(function(error) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.