You need to sign in to do that
Don't have an account?
bouscal
Loop through Cases, create List of Parent Cases?
I want to loop through a list of existing Cases and capture the Parent Case into another list.
What's the best way to accomplish this? This code doesn't work because I'm trying to add an ID as an Object, so how do I add the sObject?
What's the best way to accomplish this? This code doesn't work because I'm trying to add an ID as an Object, so how do I add the sObject?
List<Case> childCases = new List<Case>([SELECT id, parentid FROM Case WHERE condition exists]); List<Case> parentCases = new List<Case>(); for(Case c:childCases{ parentCases.add(childCases.ParentId); }
All Answers