+ Start a Discussion

Visualforce display subquery columns

Hi ! I have this query
SELECT Id, Name, (SELECT Proveedores__c FROM Proveedores__r), (select name from opportunities where createddate =this_year and stagename='Ganada') FROM Account
where id in (SELECT Cuenta__c FROM Proveedores__c)
and id in (select accountid from opportunity where createddate =this_year and stagename='Ganada')    

But now i'm stuck in how i can show all the Account Name, the Proveedores__c columns and the Opportunity name in a visualforce page

I'll really appreciate your help!!!
Hi Ecorona,

Here you need to create wrapper class .You need to create wrapper list gettter Setter to display in Vf page . Also one thing here you need to keep in mind that your opportunity and Proveedores__c records may differ in size .opportunity and Proveedores__c  will be more then one for one account .So cases wil come where Account Name wil repeat and if Opportunity and Proveedores__c size wil very then the column will be blank .

Let me know if it helps !!
Manojj! thank you so much, I'll try with the wrapper class