Created
December 26, 2011 20:44
-
-
Save barelyknown/1522089 to your computer and use it in GitHub Desktop.
Textmate Snippet for Sobject Maps by Id
This file contains hidden or 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<Id, ${1/./\u$0/:enumerate}__c> $1Map = new Map<Id, ${1/./\u$0/}__c>(); | |
for (${1/./\u$0/}__c $1: $1s) { | |
$1Map.put($1.id, $1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since there isn't a way to dynamically create a Map of SObjects by ID if you're using Database.query() instead of straight SOQL, I wrote this snippet for Textmate that generates that code.