February 13, 2012

To open new page from current page using APEX

The below code is used to open new page 'AddAllBlog' from current page.

Apex Code:

  public PageReference skip()
  PageReference pg = new PageReference('/apex/AddAllBlog');
  return pg;  

If you give URL as 'http://google.com' instead of '/apex/AddAllBlog', it will open google website.

1 comment:

  1. Really sharing is caring you proved with your blog.And my question is can we pass vf page name as a string through page reference