You need to sign in to do that
Don't have an account?

Display list of ids
Hi folks,
Can anyone tell me how to display the list of id values???
My apex class is:
public class ListIdValues{
public static List<Id> IdValues(){
list<Id> a=new list<Id>();
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
return a;
}
}
I tried like
List<id> lis=ListIdValues.IdValues();
for(Integer j=0;j<lis.size();j++)
System.debug('list values='+ lis[j]);
how to display all the values in anonymous window??
Can anyone tell me how to display the list of id values???
My apex class is:
public class ListIdValues{
public static List<Id> IdValues(){
list<Id> a=new list<Id>();
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
return a;
}
}
I tried like
List<id> lis=ListIdValues.IdValues();
for(Integer j=0;j<lis.size();j++)
System.debug('list values='+ lis[j]);
how to display all the values in anonymous window??
All Answers
===============================================================================================
1. Create new class and Save following code:
public class ListIdValues{
public static List<Id> IdValues(){
list<Id> a=new list<Id>();
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
a.add('00E90000000eytMEH1');
return a;
}
}
2. Open Developer Console:
Go to Your Name => Developer Console
3. Go to Debug Menu & Select Open Execute Anonymous Window
OR
Press: CTRL+E
Small winow will open after completion of step 3
4. Paste following code:
List<id> lis=ListIdValues.IdValues();
for(Integer j=0;j<lis.size();j++)
System.debug('list values='+ lis[j]);
5. Press Execute Button, that available below in the execute anonymous window.
===============================================================================================
I hope, code should execute successfully.
Please let me know if you find any issue.
Thanks & Regards,
Ranjeet Singh.
1. Create a Debug Log for User
2. See in the Developer Console:
in Developer Console:
1. Go to Logs tab, that available below in the Developer Console.
2. Double Click on generated log.
3. in the log filter, Select Debug Only
You can finally see the result.