You need to sign in to do that
Don't have an account?
karol.freeberg
Nested list question.
I have a nested list issue. I have two lists of IDs and I'm trying to combine them into one list so I can return the list and then split it back out after it is returned. This is what I have.
List<List<ID>> AllIDLists = New List<List<ID>>();
AllIDLists.add(mailToIds);
AllIdLists.add(WhatOppIDs);
Return AllIdLists;
So first I'm not sure that the list definition is correct. The definition should accomodate basically one list that contains 2 lists.
My second question is then what is the best way to split the lists back out. My code for that is below.
List<ID> oppIdsList = New List<ID>{AllIdLists.get(0)};
List<ID> whatIdsList = New List<ID>{AllIdLists.get(1)};
Any help on what I am doing wrong here is appreciated.
List<List<ID>> AllIDLists = New List<List<ID>>();
AllIDLists.add(mailToIds);
AllIdLists.add(WhatOppIDs);
Return AllIdLists;
So first I'm not sure that the list definition is correct. The definition should accomodate basically one list that contains 2 lists.
My second question is then what is the best way to split the lists back out. My code for that is below.
List<ID> oppIdsList = New List<ID>{AllIdLists.get(0)};
List<ID> whatIdsList = New List<ID>{AllIdLists.get(1)};
Any help on what I am doing wrong here is appreciated.
Here is the solution for your problem
Hope that resolved your query. please let me know if you need further help.
All Answers
List<Id> mailToIds = new List<Id>();
List<ID> WhatOppIDs = new List<ID>();
Here is the solution for your problem
Hope that resolved your query. please let me know if you need further help.
to filter email address, you can use Set object. Since set is not allowing duplicate value for the same. once all Ids are filtered you can use it for sending email purpose. hope that resolve your query.
If my answer helps you find the solution of your problem. Please do mark as best Answer for the problem.