visualforce - cant able to query and view parent and son opportunity -



visualforce - cant able to query and view parent and son opportunity -

i converting code parent , boy chance

public class accconhierarchy { private list<account> acc; public list<accountwrap> accountlist { get; set; } public accconhierarchy (){ list<contactwrap> cw; accountlist = new list<accountwrap>(); acc = [select id,name,industry,billingcountry,createdbyid,(select id,name,email,phone contacts) business relationship limit 20]; for(account a:acc){ cw = new list<contactwrap>(); for(contact co : a.contacts){ cw.add(new contactwrap(co)); } accountlist.add(new accountwrap(a,false,cw)); } } public class accountwrap{ public business relationship oaccount{get;set;} public boolean isselected{get;set;} public list<contactwrap> contactset{get;set;} public accountwrap(account a,boolean b, list<contactwrap> c){ oaccount=a; isselected=b; contactset =c; } } public class contactwrap{ public contact ocontact{get;set;} public boolean isselected{get;set;} public contactwrap(contact a){ ocontact=a; isselected=false; } } }

i converting code in such way parent , kid opportunities view

parent chance lookup field parent_opportunity__c

public class accconhierarchy { private list<opportunity> acc; private list<opportunity> acc1; public list<accountwrap> accountlist { get; set; } public list<contactwrap> cw { get; set; } public accconhierarchy (){ list<contactwrap> cw; accountlist = new list<accountwrap>(); acc = [select id,name,parent_opportunity__c,accountid chance parent_opportunity__c!=null]; acc1 = [select id,name,parent_opportunity__c,accountid chance parent_opportunity__c=null]; for(opportunity a:acc){ cw = new list<contactwrap>(); for(opportunity co : acc1){ cw.add(new contactwrap(co)); } accountlist.add(new accountwrap(a,false,cw)); } } public class accountwrap{ public chance oaccount{get;set;} public boolean isselected{get;set;} public list<contactwrap> contactset{get;set;} public accountwrap(opportunity a,boolean b, list<contactwrap> c){ oaccount=a; isselected=b; contactset =c; } } public class contactwrap{ public contact ocontact{get;set;} public boolean isselected{get;set;} public contactwrap(contact a){ ocontact=a; isselected=false; } } }

i getting error e cant able query , view parent , boy opportunity

rror error: accconhierarchy compile error: constructor not defined: [accconhierarchy.contactwrap].(opportunity) @ line 15 column 23

visualforce apex

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -