You need to sign in to do that
Don't have an account?
Taruni
Copy few list values to another list
Hi,
I was trying to copy some of the List values to another List.
eg: If List1 ={'A','B','C'}
then I want to copy only List[0] and List[2] values to another list "List2".
please help me with the code.
Hi,
You have to make one change in your code.
see below code.
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
All Answers
Hi Taruni,
You have to put if condition to check the size of the List1 to resolve the List index out of bound issue.
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator
Yes Its helped me and my requirement and Really great!!!
Thank you.
Srinivas
I was able to add List[0] to sublistQA but on UI for list[2], I am getting System.ListException: List index out of bounds: 2
Hi,
You have to make one change in your code.
see below code.
Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator