function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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