Activity › Forums › Salesforce® Discussions › What is the significance of keyset() method of MAP in Salesforce?
Tagged: Key Value, Keyset, Map, Methods in Salesforce
-
What is the significance of keyset() method of MAP in Salesforce?
Posted by shradha jain on August 3, 2018 at 12:34 PMWhat is the significance of keyset() method of MAP in Salesforce?
Patrick Avitan Drahi replied 4 years, 7 months ago 10 Members · 9 Replies -
9 Replies
-
Hello shradha,
keyset() Returns a set that contains all of the keys in the map.
example:-
Map<String, String> colorCodes = new Map<String, String>();
colorCodes.put(‘Red’, ‘FF0000’);
colorCodes.put(‘Blue’, ‘0000A0’);Set <String> colorSet = new Set<String>();
colorSet = colorCodes.keySet();The above example will return the list of the keys i.e red and blue.
thanks.
- [adinserter block='9']
-
Hi,
It returns you set of keys in map.
Hope this helps.
-
keyset() method : It is a method used on map that returns a set that contains all of the keys present in the map.
-
In Salesforce, keyset() Returns a set that contains all of the keys in the map.
-
keyset() is a predefined method in map class that returns a set that contains all of the keys in the map.
-
Hi Shradha,
keyset() method returns a set of all the keys in a map
-
Hii Shradha,
keySet() Returns a set that contains all of the keys in the map. put(key, value): Associates the specified value with the specified key in the map. putAll(fromMap) Copies all of the mappings from the specified map to the original map.
-
Can anyone please help ??
How to get specific key by passing value in map?
-
In the field there is the following formula which checks the values in the picklist and text fields and returns 1 or 0 respectively:if ((Picklist__c = “Call Later” && CB__C = False), 1.0)What is wrong with this formula?
Log In to reply.