Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
Hi there,

i did a method supposed to redirct into Quote details page, but it doesnt couldyou help please.

the method is excuted success, but redirect doesn't work.

qid is the ID of the quote.

Many thanks

public PageReference redirectQ(id qid){

System.debug('STARTING redirectQ: '+qid);

quote q = [SELECT id, name FROM QUOTE WHERE id=:qid];

System.debug('quote q: '+ q);

PageReference QuotePage = new PageReference(qid);

System.debug('QuotePage: ' + QuotePage);

QuotePage.setRedirect(true);

return QuotePage;

}

 
7 answers
  1. Apr 13, 2017, 1:25 PM

    Here's a catch! From the vf page, savePDF button is getting called but, this method is returning void. You need to either write the code of redirectQ method inside the savePDF method or simply call the redirectQ method as following with changing the return type from void to Pagereference of the savePDF method.

    public Pagereference savePDF() {

    //Your existing logic

    return redirectQ(aid);

    }

Loading
0/9000