Newer Version Available

This content describes an older version of this product. View Latest

currentPage()

Returns the current page's PageReference.

Signature

public System.PageReference currentPage()

Return Value

Type: System.PageReference

Example

This code segment returns the id parameter of the current page.

1public MyController() {
2    account = [
3        SELECT Id, Name, Site 
4        FROM Account 
5        WHERE Id =
6            :ApexPages.currentPage().
7             getParameters().
8             get('id')
9    ];
10}