Activity Forums Salesforce® Discussions What is trigger newMap keySet () in Salesforce?

  • Anjali

    Member
    April 29, 2020 at 12:58 pm

    Trigger.newMap.keySet() gives you id of the all record which are going to update but in the case of before insert you will get null because record still don't have any id as it is going to insert

  • Shweta

    Member
    April 29, 2020 at 1:52 pm

    Trigger.newMap: It is a map of all records in your trigger. The key used in the map is the record ID, and the value is the record itself.
    .keySet() is a method used on maps that returns all the keys of the map. Since the key in the map above is the record ID, you are returned a set of all IDs on your map.

  • Marziya

    Member
    April 29, 2020 at 1:55 pm

    The key used in the map is the record ID, and the value is the record itself.
    .keySet() is a method used on maps that returns all the keys of the map. Since the key in the map above is the record ID, you are returned a set of all IDs on your map.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos