Activity Forums Salesforce® Discussions What is page reference in Salesforce?

  • Arun

    Member
    January 23, 2020 at 9:30 am

    PageReference in Salesforce is a reference to an instantiation of a page. Among other attributes, PageReferences consist of a URL and a set of query parameter names and values.

    Use a PageReference object:
    · To view or set query string parameters and values for a page
    ·  To navigate the user to a different page as the result of an action method

    Methods
    PageReference methods are all called by and operate on a particular instance of a PageReference.

  • Kirandeep

    Member
    January 23, 2020 at 11:10 am

    Hi Aditya.

    Page reference is a class which consist of a URL and a set of query parameter names and values and
    is use to  navigate the user to a different page or Url as the result of an action method.

    Example :
    
    public PageReference returnPage() {
            // Send the user to the detail page for the new account.
            PageReference acctPage = new ApexPages.StandardController(account).view();
            acctPage.setRedirect(true);
            return acctPage;
        }

     

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos