Last active
August 29, 2015 14:05
-
-
Save joshbirk/0172ef025c5f002e8411 to your computer and use it in GitHub Desktop.
OppHomeComponent
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
| public class OpportunitiesController { | |
| public List<Opportunity> opportunities {get; set;} | |
| public OpportunitiesController() { | |
| opportunities = [SELECT Id, Name, Account.Name, ExpectedRevenue, CloseDate from Opportunity WHERE OwnerId = :UserInfo.getUserId()]; | |
| } | |
| } |
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
| <apex:page showHeader="false" controller="OpportunitiesController" standardStylesheets="true"> | |
| <style> | |
| th { background-color: #ccc; } | |
| td { padding: 5px; padding-left: 0px; background-color: white; } | |
| </style> | |
| <apex:pageBlock > | |
| <apex:pageBlockSection title="My Opportunities" columns="1"> | |
| <apex:dataTable value="{!opportunities}" var="opp" > | |
| <apex:column> | |
| <apex:facet name="header">Name</apex:facet> | |
| <apex:outputLink value="/{!opp.Id}" target="_top"> | |
| <apex:outputText value="{!opp.name}"/> | |
| </apex:outputLink> | |
| </apex:column> | |
| <apex:column> | |
| <apex:facet name="header">Account</apex:facet> | |
| <apex:outputText value="{!opp.Account.Name}"/> | |
| </apex:column> | |
| <apex:column> | |
| <apex:facet name="header">Expected Revenue</apex:facet> | |
| <apex:outputText value="{0,number,$#,###,###.00}"> | |
| <apex:param value="{!opp.ExpectedRevenue}" /> | |
| </apex:outputText> | |
| </apex:column> | |
| </apex:dataTable> | |
| </apex:pageBlockSection> | |
| </apex:pageBlock> | |
| </apex:page> |
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
| public class OpportunitiesController { | |
| public List<Opportunity> opportunities {get; set;} | |
| public OpportunitiesController() { | |
| opportunities = [SELECT Id, Name, Account.Name, ExpectedRevenue, CloseDate from Opportunity WHERE OwnerId = :UserInfo.getUserId() AND ExpectedRevenue > 20000 AND StageName = 'Closed']; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment