You need to sign in to do that
Don't have an account?
Sagar Sharma
How can I get subList of a List in Apex?
I have got a list of SObjects having N number of items/sObjects
SObject[] sList = [sobject1, sboject2, sboject3, ........ , sobjectN];
How can I get just 10 items from the begining of the list
Thanks in advance!
SObject[] sList = [sobject1, sboject2, sboject3, ........ , sobjectN];
How can I get just 10 items from the begining of the list
Thanks in advance!
I m not sure if there is an easy & short way.. but looping the original list and getting the top 10 items into a seperate list is an option
SObject[] subList = new List<SObject>();
for(Integer a = 0; a < 10; a++){
subList.add(sList[a]);
}