Created
May 22, 2015 02:37
-
-
Save oscartcy/fdd40cc07b1be8dae1a0 to your computer and use it in GitHub Desktop.
Convert List to Map for dynamically generated SOQL
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
| //Your dynamic query | |
| String accountDynamicQuery = 'select id from account limit 50000' ; | |
| //Typecasting it to map | |
| Map<id,account> mapAcc = new Map<id,account>((List<account>)Database.query(accountDynamicQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment