+ Start a Discussion
Nisha Babu 8Nisha Babu 8 

How to add some of the fields and values of a map to another map that is just created.

Vinay JVinay J
Iterate over the map, and add values to new based on the criteria.
Map<String, String> originalMap;
Map<String, String> newMap;

for(String s : originalMap.keySet()) {
    if(condition == true) {
        newMap.put(s, originalMap.get(s));
Nisha Babu 8Nisha Babu 8
Hi Vinay,

Thank You.
Map <String, Schema.SObjectField> schemaMap;
Map<String, Schema.SObjectField> comparisonFieldMapobject ;

When I store valuesthe result I am getting:
Keys Map{, date__c, name}
Value Map(Name, Date__c)

I could not see the actual values that is stored in the field.
Is it that values stored in the secod map or just the field name

How could I see the values of a field