Skip to main content
added 124 characters in body
Source Link
user75427
user75427

I have just made a simple change. Try out with this.Set will only include unique values.Suppose your account with 2 different id but same names. This will only take one value. Or just use the same myList to return

public class Soql_Ct {
public list<Account> accounts {set;get;}
public List<Account> myList {set;get;}
public Soql_Ct (){
    myList=[select Id,Name,Phone,Industry,Rating,Ownership from Account];
    accounts=new list<Account>();
    accounts.addAll(myList);
}    

}

I have just made a simple change. Try out with this

public class Soql_Ct {
public list<Account> accounts {set;get;}
public List<Account> myList {set;get;}
public Soql_Ct (){
    myList=[select Id,Name,Phone,Industry,Rating,Ownership from Account];
    accounts=new list<Account>();
    accounts.addAll(myList);
}    

}

I have just made a simple change. Try out with this.Set will only include unique values.Suppose your account with 2 different id but same names. This will only take one value. Or just use the same myList to return

public class Soql_Ct {
public list<Account> accounts {set;get;}
public List<Account> myList {set;get;}
public Soql_Ct (){
    myList=[select Id,Name,Phone,Industry,Rating,Ownership from Account];
    accounts=new list<Account>();
    accounts.addAll(myList);
}    

}

Source Link
user75427
user75427

I have just made a simple change. Try out with this

public class Soql_Ct {
public list<Account> accounts {set;get;}
public List<Account> myList {set;get;}
public Soql_Ct (){
    myList=[select Id,Name,Phone,Industry,Rating,Ownership from Account];
    accounts=new list<Account>();
    accounts.addAll(myList);
}    

}