Created
October 9, 2015 21:23
-
-
Save seanpat09/8e2453c9a9104dd991e3 to your computer and use it in GitHub Desktop.
Salesforce Map Case-Sensitivity Inconsistency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); | |
System.assert( gd.ContainsKey('CampaignMember') ); | |
System.assert( gd.ContainsKey('campaignmember') ); | |
System.assert( gd.ContainsKey('CAMPAIGNMEMBER') ); | |
System.assert( gd.keyset().contains('campaignmember') ); | |
System.assert( !gd.keyset().contains('CampaignMember') ); | |
System.assert( !gd.keyset().contains('CAMPAIGNMEMBER') ); | |
Map<String, String> colors = new Map<String,String>{ | |
'Red' => '#FF0000' | |
}; | |
System.assert( colors.ContainsKey('Red') ); | |
System.assert( !colors.ContainsKey('red') ); | |
System.assert( !colors.ContainsKey('RED') ); | |
System.assert( colors.keyset().contains('Red') ); | |
System.assert( !colors.keyset().contains('red') ); | |
System.assert( !colors.keyset().contains('RED') ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment