Last active
October 13, 2017 04:19
-
-
Save sfdcfanboy/bb6a98fa7f9cf70d71b6d4160e8166a2 to your computer and use it in GitHub Desktop.
This file contains 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
global with sharing class OppsWithMatches{ | |
global List<Opportunity> Opps{get;set;} | |
global String accountId{get;set;} | |
global account account{ | |
get { | |
Account = [Select Id, name from Account where id =: accountId]; | |
return account; } | |
set; | |
} | |
global OppsWithMatches(){ | |
} | |
global List<Opportunity> Opps{ | |
get{ | |
posToDisplay = new List<Opportunity>(); | |
List<Opportunity> oppList = [SELECT Id,Name,Description,Amount,(SELECT Id,Name,Email__c FROM Matches__r) FROM Opportunity WHERE AccountId=:accountId]; | |
for(Opportunity p:oppList){ | |
Boolean display = false; | |
for(Match__c m:p.matches__r){ | |
if(m.status__c == 'Confirmed'){ | |
display = true; | |
} | |
} | |
if(display==true){ | |
posToDisplay.add(p); | |
} | |
} | |
return posToDisplay; | |
} | |
set; | |
} | |
global String NewLine { | |
get { return '\r\n'; } | |
set; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment