You need to sign in to do that
Don't have an account?
Bhaskar Chowdary
Preventing System.ListException: Duplicate id in list:
Hello every one I have a requirement like dont allo duplicate recoreds in my related list .
I created wrapper class that contains checkbox with selected questions
if select check box and click on button copy the selected questions to my related list that is lookup so here every time duplicated records also coming into that so how to restrict that by using apex please send any sample code to bhaskar.anumolu@gmail.com
Add those list values to a set. Set contains unique data.
List<String> strList = new List<String>();
strList.add(YourValue);
Set<String> strSet = new Set<String>();
strSet.addAll(strList);