Activity Forums Salesforce® Discussions VF Page rendered as pdf download without redirecting to any screen

  • VF Page rendered as pdf download without redirecting to any screen

    Posted by Abhishek on June 12, 2020 at 9:31 am

    I've a vf page rendered as pdf which has to be downloaded on click of a button. This button has to be present on detail page of 3 objects: Account, Contact and Opportunity. To support 3 objects, a generic custom controller is written and the button is made a URL type, being opened in existing window. I've added 'content-disposition' through apex to download the page.

    The problem is, on click of the button the page goes to a blank screen and the pdf gets downloaded. Is there a way that on button click the pdf gets downloaded and the window stays on the record page without directing to blank screen (or anywhere else)?

    Please see attached screenshots of the button and its behaviour.

    • This discussion was modified 4 years, 5 months ago by  Abhishek.
    • This discussion was modified 2 years, 2 months ago by  Forcetalks.
    • This discussion was modified 2 years, 2 months ago by  Forcetalks.
    • This discussion was modified 2 years, 2 months ago by  Forcetalks.
    Prashanth replied 2 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Prashanth

    Member
    September 12, 2022 at 6:42 pm

    Have you got any Solution for this

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos