Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:selectList id="accts" value="{!myObject.Report__c}" title="Report">
- <apex:selectOptions value="{!reports}"></apex:selectOptions>
- </apex:selectList>
- public List<selectOptions> getReports()
- {
- List<selectOption> options = new List<selectOption>():
- folder[] ff = [select id from folder where developername = 'My_Reports_Folder'];
- id fid = (ff.isEmpty()) ? null : ff[0].id;
- report[] rpts = [select id, name from report where ownerid = : fid and ownerid != null order by name];
- for (int i=0; i<rpts.length; i++) {
- options.add(new selectOption(rpts[i].id, rpts[i].name));
- }
- return options;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement