function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
fofofofo 

Duplicate in List

In my order insert trigger, i need to update contact for the order information, I know there are duplicate records in the my contact list. so I use

Contact[] contactToUpdate = new List<Contact>(new Set<Contact>(contactList));

to remove the duplicates. 

 

but I still receive the error message: duplicate in List. 

 

any idea?? 

 

Thanks

sanjdevsanjdev

Hi

 

List datatype always contain duplicate value. Please use set datatype to remove duplicate.

 

Cheers

Sanj