Created
February 14, 2020 19:31
-
-
Save brianbier/65db651af6e7a3c5ea7aac8d9e373d55 to your computer and use it in GitHub Desktop.
New way of creating a map from recently inserted records
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
//After Inserting opportunities | |
List<Opportunity> opptys = new List<Opportunity>(); | |
insert opptys; | |
// Get the IDs of the opportunities we just inserted | |
Map<Id, Opportunity> opptyMap = new Map<Id, Opportunity>(opptys); | |
//This will create a map of the opportunities | |
// Will allow you to do this | |
List<Id> opptyIds = new List<Id>(opptyMap.keySet()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment