You need to sign in to do that
Don't have an account?
Simrin
temp will populate value 5 times
searchResult should be addition/summation of temp
adding list to list
public List<ProfileSkillUser> searchResult{get;set;} function(){ public List<ProfileSkillUser> temp; for (5 times){ temp = [SELECT User.FirstName, User.LastName, ProfileSkill.Name, EFX_Type__C, ProfileSkill.EFX_Category__c, EFX_Skill_assessment__c FROM ProfileSkillUser]; } }
temp will populate value 5 times
searchResult should be addition/summation of temp
You can add list elements from one list to another by simply calling the addAll() method.
eg. List<Account> accounts1 = new List<Account>{a,b,c};
List<Account> accounts2 = new List<Account>{d,e,f};
accounts1.addAll(accounts2); //this will add all elements from list accounts2 to the list accounts1.
All Answers
Will you please elaborate on your requirement so we can help.
Thanks,
Pratik
As salesforce is having some governor limits, we should not query inside the for loop.
Hope this helps.
P.S - Please mark this as solution by selecting it as best answer if this solves your problem.
Thanks
You can add list elements from one list to another by simply calling the addAll() method.
eg. List<Account> accounts1 = new List<Account>{a,b,c};
List<Account> accounts2 = new List<Account>{d,e,f};
accounts1.addAll(accounts2); //this will add all elements from list accounts2 to the list accounts1.
I can also, use DML inside for loop