You need to sign in to do that
Don't have an account?
Simrin
Hello,
I have a list which adds the list to another list.
In one use case, tempResult gets 1 row at a time.
searchResult will have 5 rows
this is doing a OR kind of operand.
I now need to make a AND kind of operand.
get comon rows from 5 list and popumlate one list
Hello,
I have a list which adds the list to another list.
In one use case, tempResult gets 1 row at a time.
searchResult will have 5 rows
public with sharing class Controller { public List<ProfileSkillUser> searchResult{get;set;} public Controller() { List<ProfileSkillUser> tempResult; searchResult = new List<ProfileSkillUser>(); for(integer i=0; i<5; i++){ tempResult = new List<ProfileSkillUser>(); tempResult = [SELECT User.FirstName, User.LastName, ProfileSkill.Name FROM ProfileSkillUser WHERE ProfileSkill.Name =:i ORDER BY UserId ]; searchResult.addAll(tempResult); } } }
this is doing a OR kind of operand.
I now need to make a AND kind of operand.
Please use below code.
Let us know if it helps you.
All Answers
If i make searchResult as Map. Wont it owerrite the previous value.
presently what this is doing is.
for(1st interation){
tempResult = 1 row
}
for(2nd interation){
tempResult = 2 row
}
for(3rd interation){
tempResult = 1 row
}
for(4th interation){
tempResult = 3 row
}
for(5th interation){
tempResult = 1 row
}
searchResult = 1+2+1+3+1 (8 rows)s
What i need is.
tempResult1 in (tempResult2 in(tempResult3) until 5
It will override previous value if you consider it as a map. It should find a unique key in map.
Let us know if it helps you.
Please use below code.
Let us know if it helps you.