Created
June 8, 2015 13:52
-
-
Save dangt85/d8c4e6c33cee0e35aa5a to your computer and use it in GitHub Desktop.
Custom List Controller class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
@Author <Author Name> | |
@name @@NAME@@ | |
@CreateDate <dd/mm/yyyy> | |
@Description <purpose of the class> | |
@Version <1.0> | |
@reference <Referenced program names> | |
*/ | |
public with sharing class @@NAME@@ { | |
// ApexPages.StandardSetController must be instantiated | |
// for standard list controllers | |
public ApexPages.StandardSetController setCtrl { | |
get { | |
if(setCtrl == null) { | |
setCtrl = new ApexPages.StandardSetController(Database.getQueryLocator( | |
[SELECT Name, CloseDate FROM Opportunity])); | |
} | |
return setCtrl; | |
} | |
set; | |
} | |
// Initialize setCon and return a list of records | |
public Opportunity[] getOpportunities() { | |
return (Opportunity[]) setCtrl.getRecords(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment