Skip to content

Instantly share code, notes, and snippets.

@lfreeland
Created June 29, 2018 19:40
Show Gist options
  • Save lfreeland/02c13d10ebd5873e76209891833d4c4c to your computer and use it in GitHub Desktop.
Save lfreeland/02c13d10ebd5873e76209891833d4c4c to your computer and use it in GitHub Desktop.
List<Id>.Contains Salesforce Bug Apex Script Example
Id firstId = 'a0a5B000002XgIoQAK';
List<Id> ids = new List<Id>{ firstId };
Id sameId = 'a0a5B000002XgIoQAK';
// false... wtf?
system.debug(' list of ids contains same id? ' + ids.contains(sameId));
Set<Id> setOfIds = new Set<Id>{ firstId };
// true
system.debug(' set of ids contains same id? ' + setOfIds.contains(sameId));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment