You need to sign in to do that
Don't have an account?

an opinion
hi!
i had made a visualforce page of a custom object calls zones__c and one of the related list is opportunities.
when i list oportunities, shows all of the opportunities but i want to filter by stagename = closed Won.
what is the best way? component? extended controller?
can anyone gives me an example please?
tks!
You can just use an extension where you can query the opportunity and apply the where clause.
Sample Query
Select id from opportunity where opportunity__c = :yourId and stagename = 'Closed Own'
You can use SOQL Query in a controller extension to get list of opportunities by using filter criteria. Go through the sample code given below :
controller code:
public class cls_oppcontroller
{
public cls_oppcontroller(ApexPages.StandardController acon){}
public List<opportunity> getopportunites()
{
List<opportunity> opp = [select StageName,name from opportunity o where o.name = 'closedwon'];
return opp;
}
}
Hope this helps.
hum..ok. but i forgot something.. i have professional :(