Skip to content

Instantly share code, notes, and snippets.

@brianbier
Created February 14, 2020 19:31
Show Gist options
  • Save brianbier/65db651af6e7a3c5ea7aac8d9e373d55 to your computer and use it in GitHub Desktop.
Save brianbier/65db651af6e7a3c5ea7aac8d9e373d55 to your computer and use it in GitHub Desktop.

Revisions

  1. brianbier renamed this gist Feb 14, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. brianbier created this gist Feb 14, 2020.
    9 changes: 9 additions & 0 deletions getidofRecords
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    //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());