You need to sign in to do that
Don't have an account?
mukesh gupta
Related list By SOQL
Hi Expert,
I want to get Account realted list that would be display in Visualforce page. so i am using below query. but when i run the code and store each object value in list then get error "List index is outbound"
public List<Account> accList{get;set;}
public List<Opportunity> oppList{get;set;}
public List<Contact> contList{get;set;}
List<Account> acc= [SELECT Name, (SELECT Name, Type FROM Opportunities),(SELECT Name, email FROM Contacts) FROM Account where Name = 'Dickenson plc'];
accList = acc;
contList = new List<Contact>(acc[0].Contacts);
oppList = new List<Opportunity>(acc[0].Opportunities);
Please suggest
Thanks
Mukesh
I want to get Account realted list that would be display in Visualforce page. so i am using below query. but when i run the code and store each object value in list then get error "List index is outbound"
public List<Account> accList{get;set;}
public List<Opportunity> oppList{get;set;}
public List<Contact> contList{get;set;}
List<Account> acc= [SELECT Name, (SELECT Name, Type FROM Opportunities),(SELECT Name, email FROM Contacts) FROM Account where Name = 'Dickenson plc'];
accList = acc;
contList = new List<Contact>(acc[0].Contacts);
oppList = new List<Opportunity>(acc[0].Opportunities);
Please suggest
Thanks
Mukesh
Thanks!
All Answers
Let me know if this helps :)
Thanks!
I am using below code. but not getting list on VF page. This is Apex controller
and this is VF page
Please suggest what's i am doing wrong.
Thanks
mukesh
Thanks!
Your code is correct but you mistake in
String searchItem = '*'+selectedValue+'*';
if you wlidcard card query then you have to udr LIke with '%'(Multi character) or '_'(Single character)
Thanks